- editor.on( 'selectionChange', onSelectionChangeFixBody, null, null, 1 );\r
+ editor.on( 'selectionChange', function( evt )\r
+ {\r
+ if ( editor.readOnly )\r
+ return;\r
+\r
+ var sel = editor.getSelection();\r
+ // Do it only when selection is not locked. (#8222)\r
+ if ( sel && !sel.isLocked )\r
+ {\r
+ var isDirty = editor.checkDirty();\r
+ editor.fire( 'saveSnapshot', { contentOnly : 1 } );\r
+ onSelectionChangeFixBody.call( this, evt );\r
+ editor.fire( 'updateSnapshot' );\r
+ !isDirty && editor.resetDirty();\r
+ }\r
+\r
+ }, null, null, 1 );\r