JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / plugins / format / plugin.js
index 9c7c1e3..bb0d997 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -21,20 +21,19 @@ CKEDITOR.plugins.add( 'format',
                {\r
                        var tag = tags[ i ];\r
                        styles[ tag ] = new CKEDITOR.style( config[ 'format_' + tag ] );\r
+                       styles[ tag ]._.enterMode = editor.config.enterMode;\r
                }\r
 \r
                editor.ui.addRichCombo( 'Format',\r
                        {\r
                                label : lang.label,\r
                                title : lang.panelTitle,\r
-                               voiceLabel : lang.voiceLabel,\r
                                className : 'cke_format',\r
-                               multiSelect : false,\r
-\r
                                panel :\r
                                {\r
-                                       css : [ config.contentsCss, CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],\r
-                                       voiceLabel : lang.panelVoiceLabel\r
+                                       css : editor.skin.editor.css.concat( config.contentsCss ),\r
+                                       multiSelect : false,\r
+                                       attributes : { 'aria-label' : lang.panelTitle }\r
                                },\r
 \r
                                init : function()\r
@@ -57,7 +56,11 @@ CKEDITOR.plugins.add( 'format',
 \r
                                        styles[ value ].apply( editor.document );\r
 \r
-                                       editor.fire( 'saveSnapshot' );\r
+                                       // Save the undo snapshot after all changes are affected. (#4899)\r
+                                       setTimeout( function()\r
+                                       {\r
+                                               editor.fire( 'saveSnapshot' );\r
+                                       }, 0 );\r
                                },\r
 \r
                                onRender : function()\r