File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " grapesjs" ,
3
3
"description" : " Free and Open Source Web Builder Framework" ,
4
- "version" : " 0.12.53 " ,
4
+ "version" : " 0.12.54 " ,
5
5
"author" : " Artur Arseniev" ,
6
6
"license" : " BSD-3-Clause" ,
7
7
"homepage" : " http://grapesjs.com" ,
Original file line number Diff line number Diff line change @@ -268,22 +268,18 @@ module.exports = () => {
268
268
if ( em ) {
269
269
const config = em . getConfig ( ) ;
270
270
const cssC = em . get ( 'CssComposer' ) ;
271
- const avoidInline = config . avoidInlineStyle ;
272
271
const state = ! config . devicePreviewMode ? model . get ( 'state' ) : '' ;
272
+ const valid = classes . getStyleable ( ) ;
273
+ const hasClasses = valid . length ;
273
274
const opts = { state } ;
274
275
275
- // If true the model will be always a rule
276
- if ( avoidInline ) {
277
- const rule = cssC . getIdRule ( id , opts ) ;
278
- return rule ? rule : cssC . setIdRule ( id , { } , opts ) ;
279
- } else if ( classes && classes . length ) {
276
+ if ( hasClasses ) {
280
277
const deviceW = em . getCurrentMedia ( ) ;
281
- const valid = classes . getStyleable ( ) ;
282
278
const CssRule = cssC . get ( valid , state , deviceW ) ;
283
-
284
- if ( CssRule && valid . length ) {
285
- return CssRule ;
286
- }
279
+ if ( CssRule ) return CssRule ;
280
+ } else if ( config . avoidInlineStyle ) {
281
+ const rule = cssC . getIdRule ( id , opts ) ;
282
+ return rule ? rule : cssC . setIdRule ( id , { } , opts ) ;
287
283
}
288
284
}
289
285
You can’t perform that action at this time.
0 commit comments