JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0.1
[ckeditor.git] / _source / plugins / newpage / plugin.js
index 2c76877..6dc20be 100644 (file)
@@ -19,31 +19,15 @@ CKEDITOR.plugins.add( 'newpage',
                                exec : function( editor )\r
                                {\r
                                        var command = this;\r
-                                       function afterCommand()\r
+                                       editor.setData( editor.config.newpage_html, function()\r
                                        {\r
-                                               // Defer to happen after 'selectionChange'.\r
-                                               setTimeout( function()\r
+                                               editor.fire( 'afterCommandExec',\r
                                                {\r
-                                                       editor.fire( 'afterCommandExec',\r
-                                                       {\r
-                                                               name: command.name,\r
-                                                               command: command\r
-                                                       } );\r
-                                               }, 500 );\r
-                                       }\r
-                                       if ( editor.mode == 'wysiwyg')\r
-                                               editor.on( 'contentDom', function( evt ){\r
-\r
-                                                       evt.removeListener();\r
-                               afterCommand();\r
+                                                       name: command.name,\r
+                                                       command: command\r
                                                } );\r
-\r
-                                       editor.setData( editor.config.newpage_html );\r
+                                       } );\r
                                        editor.focus();\r
-\r
-                                       if( editor.mode == 'source' )\r
-                                               afterCommand();\r
-\r
                                },\r
                                async : true\r
                        });\r