JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / newpage / plugin.js
index 6dc20be..62c5405 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,11 +21,16 @@ CKEDITOR.plugins.add( 'newpage',
                                        var command = this;\r
                                        editor.setData( editor.config.newpage_html, function()\r
                                        {\r
-                                               editor.fire( 'afterCommandExec',\r
+                                               // Save the undo snapshot after all document changes are affected. (#4889)\r
+                                               setTimeout( function ()\r
                                                {\r
-                                                       name: command.name,\r
-                                                       command: command\r
-                                               } );\r
+                                                       editor.fire( 'afterCommandExec',\r
+                                                       {\r
+                                                               name: command.name,\r
+                                                               command: command\r
+                                                       } );\r
+\r
+                                               }, 200 );\r
                                        } );\r
                                        editor.focus();\r
                                },\r