Ticket #4795: 4795.patch
File 4795.patch, 1.7 KB (added by , 15 years ago) |
---|
-
plugin.js
103 103 // than firing the selection change event. 104 104 105 105 var savedRange, 106 savedRange2, 106 107 saveEnabled; 107 108 108 109 // "onfocusin" is fired before "onfocus". It makes it … … 161 162 0 ); 162 163 }); 163 164 164 body.on( 'keydown', disableSave ); 165 body.on( 'keydown', function() 166 { 167 if ( CKEDITOR.env.ie8Compat && editor.getSelection().getType() == CKEDITOR.SELECTION_ELEMENT ) 168 { 169 savedRange2 = editor.document.$.body.createTextRange(); 170 var sel = editor.document.$.selection.createRange(); 171 var nxt = sel.commonParentElement().nextSibling; 172 while ( nxt && nxt.nodeType != 1 ) 173 nxt = nxt.nextSibling; // skip #text 174 175 if ( nxt ) 176 { 177 savedRange2.moveToElementText( nxt ); 178 savedRange2.move( 'character', 0 ); 179 } 180 else 181 { 182 savedRange2.move( 'textedit', 1 ); 183 } 184 } 185 disableSave(); 186 }); 187 165 188 body.on( 'keyup', 166 189 function() 167 190 { … … 206 229 return; 207 230 } 208 231 } 232 try 233 { 234 savedRange = sel && sel.createRange(); 235 } 236 catch (e) 237 { 238 if ( savedRange2 ) 239 { 240 savedRange2.select(); 241 savedRange2 = null; 242 } 243 } 209 244 210 savedRange = sel && sel.createRange();211 212 245 checkSelectionChangeTimeout.call( editor ); 213 246 } 214 247 }