Ticket #3580: 3580.patch

File 3580.patch, 1.3 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/undo/plugin.js

     
    5555                        function recordCommand( event )
    5656                        {
    5757                                // If the command hasn't been marked to not support undo.
    58                                 if ( undoManager.enabled && event.data.command.canUndo !== false )
     58                                var command = event.data.command;
     59                                if ( undoManager.enabled && command.canUndo !== false &&
     60                                                !( command.canUndoAfter === false && event.name == 'afterCommandExec' ) )
    5961                                        undoManager.save();
    6062                        }
    6163
  • _source/plugins/sourcearea/plugin.js

     
    188188                        {
    189189                                editor.getCommand( 'source' ).setState( CKEDITOR.TRISTATE_DISABLED );
    190190                                editor.setMode( editor.mode == 'source' ? 'wysiwyg' : 'source' );
    191                         }
     191                        },
     192
     193                        /*
     194                         * #3580: editor.mode is empty right after executing this command, which
     195                         * causes editor.getSnapshot() to return false. Grabbing one more snapshot
     196                         * after command execution is meaningless for Source anyway.
     197                         *
     198                         * So disable it.
     199                         */
     200                        canUndoAfter : false
    192201                }
    193202        }
    194203};
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy