Ticket #8617: 8617_1.patch
File 8617_1.patch, 1.3 KB (added by , 13 years ago) |
---|
-
_source/plugins/selection/plugin.js
162 162 var fillingChar = doc && doc.removeCustomData( 'cke-fillingChar' ); 163 163 if ( fillingChar ) 164 164 { 165 var bm, 166 sel = doc.getSelection(), 167 nativeSel = sel.getNative(); 168 169 // Text selection position might get mangled by 170 // subsequent dom modification. #8617[1] 171 if ( nativeSel.anchorNode === fillingChar.$ ) 172 { 173 bm = sel.createBookmarks2()[ 0 ]; 174 // Anticipate the removed char. 175 bm.startOffset--; 176 177 if ( !nativeSel.isCollpased 178 && nativeSel.focusNode == fillingChar.$ ) 179 bm.endOffset--; 180 } 181 165 182 // We can't simply remove the filling node because the user 166 183 // will actually enlarge it when typing, so we just remove the 167 184 // invisible char from it. 168 185 fillingChar.setText( fillingChar.getText().replace( /\u200B/g, '' ) ); 169 fillingChar = 0; 186 187 // Restore the text selection afterward. #8617(2) 188 bm && sel.selectBookmarks( [ bm ] ); 170 189 } 171 190 } 172 191 … … 1724 1743 { 1725 1744 this.document.getSelection().selectRanges( [ this ] ); 1726 1745 }; 1727 } )(); 1746 } )(); 1747 No newline at end of file