X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fdiv%2Fdialogs%2Fdiv.js;h=c1bfb8ff0c932d04ef66c7115d971792505dd878;hp=e3b39c33500070a763f474a26efe5b5e8c141784;hb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;hpb=059b4c2fef02528bf1af189f7996e80652faddfb diff --git a/_source/plugins/div/dialogs/div.js b/_source/plugins/div/dialogs/div.js index e3b39c3..c1bfb8f 100644 --- a/_source/plugins/div/dialogs/div.js +++ b/_source/plugins/div/dialogs/div.js @@ -436,46 +436,38 @@ // Preparing for the 'elementStyle' field. var dialog = this, - stylesField = this.getContentElement( 'info', 'elementStyle' ), - // Reuse the 'stylescombo' plugin's styles definition. - customStylesConfig = editor.config.stylesCombo_stylesSet, - stylesSetName = customStylesConfig && customStylesConfig.split( ':' )[ 0 ]; + stylesField = this.getContentElement( 'info', 'elementStyle' ); - if ( stylesSetName ) + // Reuse the 'stylescombo' plugin's styles definition. + editor.getStylesSet( function( stylesDefinitions ) { - CKEDITOR.stylesSet.load( stylesSetName, - function( stylesSet ) - { - var stylesDefinitions = stylesSet[ stylesSetName ], - styleName; + var styleName; - if ( stylesDefinitions ) + if ( stylesDefinitions ) + { + // Digg only those styles that apply to 'div'. + for ( var i = 0 ; i < stylesDefinitions.length ; i++ ) + { + var styleDefinition = stylesDefinitions[ i ]; + if ( styleDefinition.element && styleDefinition.element == 'div' ) { - // Digg only those styles that apply to 'div'. - for ( var i = 0 ; i < stylesDefinitions.length ; i++ ) - { - var styleDefinition = stylesDefinitions[ i ]; - if ( styleDefinition.element && styleDefinition.element == 'div' ) - { - styleName = styleDefinition.name; - styles[ styleName ] = new CKEDITOR.style( styleDefinition ); + styleName = styleDefinition.name; + styles[ styleName ] = new CKEDITOR.style( styleDefinition ); - // Populate the styles field options with style name. - stylesField.items.push( [ styleName, styleName ] ); - stylesField.add( styleName, styleName ); - } - } + // Populate the styles field options with style name. + stylesField.items.push( [ styleName, styleName ] ); + stylesField.add( styleName, styleName ); } + } + } + // We should disable the content element + // it if no options are available at all. + stylesField[ stylesField.items.length > 1 ? 'enable' : 'disable' ](); - // We should disable the content element - // it if no options are available at all. - stylesField[ stylesField.items.length > 1 ? 'enable' : 'disable' ](); - - // Now setup the field value manually. - setTimeout( function() { stylesField.setup( dialog._element ); }, 0 ); - } ); - } + // Now setup the field value manually. + setTimeout( function() { stylesField.setup( dialog._element ); }, 0 ); + } ); }, onShow : function() { @@ -492,6 +484,7 @@ }, onOk : function() { + editor.fire( 'saveSnapshot' ); if ( command == 'editdiv' ) containers = [ this._element ]; else @@ -506,6 +499,7 @@ // Remove empty 'style' attribute. !containers[ i ].getAttribute( 'style' ) && containers[ i ].removeAttribute( 'style' ); } + editor.fire( 'saveSnapshot' ); this.hide(); },