Ticket #4709: 4709_2.patch
File 4709_2.patch, 2.1 KB (added by , 13 years ago) |
---|
-
_source/plugins/selection/plugin.js
92 92 { 93 93 editor.on( 'contentDom', function() 94 94 { 95 var doc = editor.document; 95 var doc = editor.document, 96 body = doc.getBody(); 96 97 97 98 if ( CKEDITOR.env.ie ) 98 99 { … … 107 108 // "onfocusin" is fired before "onfocus". It makes it 108 109 // possible to restore the selection before click 109 110 // events get executed. 110 doc.on( 'focusin', function()111 body.on( 'focusin', function() 111 112 { 112 113 // If we have saved a range, restore it at this 113 114 // point. … … 133 134 saveSelection(); 134 135 }); 135 136 136 // Check document selection before 'blur' fired, this 137 // will prevent us from breaking text selection somewhere 138 // else on the host page.(#3909) 139 editor.document.on( 'beforedeactivate', function() 137 body.on( 'beforedeactivate', function() 140 138 { 141 139 // Disable selections from being saved. 142 140 saveEnabled = false; 143 144 // IE may leave the selection still inside the145 // document. Let's force it to be removed.146 // TODO: The following has effect for147 // collapsed selections.148 editor.document.$.execCommand( 'Unselect' );149 141 }); 150 142 151 143 // IE fires the "selectionchange" event when clicking 152 144 // inside a selection. We don't want to capture that. 153 doc.on( 'mousedown', disableSave );154 doc.on( 'mouseup',145 body.on( 'mousedown', disableSave ); 146 body.on( 'mouseup', 155 147 function( evt ) 156 148 { 157 149 // IE context-menu event in table cells collapse … … 170 162 0 ); 171 163 }); 172 164 173 doc.on( 'keydown', disableSave );174 doc.on( 'keyup',165 body.on( 'keydown', disableSave ); 166 body.on( 'keyup', 175 167 function() 176 168 { 177 169 saveEnabled = true;