IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
291 | 291 | if ( evt.data.$.srcElement.nodeName != 'BODY' ) |
292 | 292 | return; |
293 | 293 | |
294 | | // If we have saved a range, restore it at this |
295 | | // point. |
296 | | if ( savedRange ) |
297 | | { |
298 | | if ( restoreEnabled ) |
299 | | { |
300 | | // Well not break because of this. |
301 | | try |
302 | | { |
303 | | savedRange.select(); |
304 | | } |
305 | | catch (e) |
306 | | {} |
307 | | |
308 | | // Update locked selection because of the normalized text nodes. (#6083, #6987) |
309 | | var lockedSelection = doc.getCustomData( 'cke_locked_selection' ); |
310 | | if ( lockedSelection ) |
311 | | { |
312 | | lockedSelection.unlock(); |
313 | | lockedSelection.lock(); |
314 | | } |
315 | | } |
316 | | |
| 294 | // Give the priority to locked selection since it probably |
| 295 | // reflects the actual situation. (#6083, #6987) |
| 296 | var lockedSelection = doc.getCustomData( 'cke_locked_selection' ); |
| 297 | if ( lockedSelection ) |
| 298 | { |
| 299 | lockedSelection.unlock( 1 ); |
| 300 | lockedSelection.lock(); |
| 301 | } |
| 302 | // Then check ff we have saved a range, restore it at this |
| 303 | // point. |
| 304 | else if ( savedRange && restoreEnabled ) |
| 305 | { |
| 306 | // Well not break because of this. |
| 307 | try { savedRange.select(); } catch (e) {} |
317 | 308 | savedRange = null; |
318 | 309 | } |
319 | 310 | }); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
30 | 30 | { |
31 | 31 | this.focus(); |
32 | 32 | |
| 33 | // Since the insertion might happen from within dialog or menu |
| 34 | // where the editor selection might be locked at the moment, |
| 35 | // update the locked selection. |
| 36 | var selection = this.getSelection(), |
| 37 | selIsLocked = selection.isLocked; |
| 38 | |
| 39 | selIsLocked && selection.unlock(); |
| 40 | |
33 | 41 | this.fire( 'saveSnapshot' ); |
34 | 42 | |
35 | 43 | insertFunc.call( this, evt.data ); |
36 | 44 | |
| 45 | selIsLocked && this.getSelection().lock(); |
| 46 | |
37 | 47 | // Save snaps after the whole execution completed. |
38 | 48 | // This's a workaround for make DOM modification's happened after |
39 | 49 | // 'insertElement' to be included either, e.g. Form-based dialogs' 'commitContents' |
… |
… |
|
83 | 93 | |
84 | 94 | if ( CKEDITOR.env.ie ) |
85 | 95 | { |
86 | | var selIsLocked = selection.isLocked; |
87 | | |
88 | | if ( selIsLocked ) |
89 | | selection.unlock(); |
90 | | |
91 | 96 | var $sel = selection.getNative(); |
92 | 97 | |
93 | 98 | // Delete control selections to avoid IE bugs on pasteHTML. |
… |
… |
|
113 | 118 | } |
114 | 119 | |
115 | 120 | $sel.createRange().pasteHTML( data ); |
116 | | |
117 | | if ( selIsLocked ) |
118 | | this.getSelection().lock(); |
119 | 121 | } |
120 | 122 | else |
121 | 123 | this.document.$.execCommand( 'inserthtml', false, data ); |