Ticket #4682: 4682_2.patch
File 4682_2.patch, 2.0 KB (added by , 14 years ago) |
---|
-
_source/plugins/selection/plugin.js
108 108 // "onfocusin" is fired before "onfocus". It makes it 109 109 // possible to restore the selection before click 110 110 // events get executed. 111 body.on( 'focusin', function( )111 body.on( 'focusin', function(evt) 112 112 { 113 // If there are elements with layout they fire this event but 114 // it must be ignored to allow edit its contents #4682 115 if ( evt.data.$.srcElement.nodeName !== 'BODY' ) 116 return; 117 113 118 // If we have saved a range, restore it at this 114 119 // point. 115 120 if ( savedRange ) … … 134 139 saveSelection(); 135 140 }); 136 141 137 body.on( 'beforedeactivate', function( )142 body.on( 'beforedeactivate', function( evt ) 138 143 { 144 // Ignore this event if it's caused by focus swtich between 145 // internal editable control type elements, e.g. layouted paragraph. (#4682) 146 if ( evt.data.$.toElement ) 147 return; 148 139 149 // Disable selections from being saved. 140 150 saveEnabled = false; 151 152 // IE before version 8 will leave cursor blinking inside the document after 153 // editor blurred unless we clean up the selection. (#4716) 154 if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) 155 { 156 // IE stack overflows when we're doing so inside table. (#5114) 157 // or an element with layout #4682 158 var parent = 159 savedRange 160 && savedRange.parentElement 161 && savedRange.parentElement(); 162 163 if ( savedRange && !( parent && (parent.tagName.toLowerCase( ) in CKEDITOR.dtd.$tableContent || parent.currentStyle.hasLayout) ) ) 164 editor.document.$.selection.empty(); 165 } 141 166 }); 142 167 143 168 // IE fires the "selectionchange" event when clicking