Ticket #4874: 4874_2.patch
File 4874_2.patch, 2.6 KB (added by , 14 years ago) |
---|
-
_source/plugins/clipboard/plugin.js
303 303 body.on( ( mode == 'text' && CKEDITOR.env.ie ) ? 'paste' : 'beforepaste', 304 304 function( evt ) 305 305 { 306 if( depressBeforePasteEvent ) 307 return; 308 306 309 getClipboardData.call( editor, evt, mode, function ( data ) 307 310 { 308 311 // The very last guard to make sure the … … 321 324 // If the "contextmenu" plugin is loaded, register the listeners. 322 325 if ( editor.contextMenu ) 323 326 { 327 var depressBeforePasteEvent; 324 328 function stateFromNamedCommand( command ) 325 329 { 326 return editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; 330 // IE Bug: queryCommandEnabled('paste') fires also 'beforepaste', 331 // guard to distinguish from the ordinary sources( either 332 // keyboard paste or execCommand ) (#4874). 333 CKEDITOR.env.ie && command == 'Paste'&& ( depressBeforePasteEvent = 1 ); 334 335 var retval = editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; 336 depressBeforePasteEvent = 0; 337 return retval; 327 338 } 328 339 329 340 editor.contextMenu.addListener( function() -
_source/plugins/contextmenu/plugin.js
177 177 } ); 178 178 } 179 179 180 // Certain forms of IE selection changes on 'contextmenu' event,181 // lock the selection before that.(#4041)182 if ( CKEDITOR.env.ie )183 {184 element.on( 'mousedown', function( event )185 {186 if ( event.data.$.button == 2 )187 {188 var selection = this.editor.getSelection();189 selection && selection.lock();190 }191 }, this );192 }193 194 180 element.on( 'contextmenu', function( event ) 195 181 { 196 182 var domEvent = event.data; … … 201 187 ( CKEDITOR.env.webkit ? holdCtrlKey : domEvent.$.ctrlKey || domEvent.$.metaKey ) ) 202 188 return; 203 189 190 // Selection will be unavailable after context menu shows up 191 // in IE, lock it now. 192 if ( CKEDITOR.env.ie ) 193 { 194 var selection = this.editor.getSelection(); 195 selection && selection.lock(); 196 } 197 204 198 // Cancel the browser context menu. 205 199 domEvent.preventDefault(); 206 200