Changeset 6636
- Timestamp:
- 04/03/11 14:50:11 (2 years ago)
- File:
-
- 1 edited
-
CKEditor/trunk/_source/plugins/selection/plugin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/trunk/_source/plugins/selection/plugin.js
r6624 r6636 187 187 }, null, null, 10 ); 188 188 189 var fillingCharBefore; 189 var fillingCharBefore, 190 resetSelection; 191 190 192 function beforeData() 191 193 { 192 var fillingChar = getFillingChar( editor.document ); 193 fillingCharBefore = fillingChar && fillingChar.getText(); 194 fillingCharBefore && fillingChar.setText( fillingCharBefore.replace( /\u200B/g, '' ) ); 194 var doc = editor.document, 195 fillingChar = getFillingChar( doc ); 196 197 if ( fillingChar ) 198 { 199 // If cursor is right blinking by side of the filler node, save it for restoring, 200 // as the following text substitution will blind it. (#7437) 201 var sel = doc.$.defaultView.getSelection(); 202 if ( sel.type == 'Caret' && sel.anchorNode == fillingChar.$ ) 203 resetSelection = 1; 204 205 fillingCharBefore = fillingChar.getText(); 206 fillingChar.setText( fillingCharBefore.replace( /\u200B/g, '' ) ); 207 } 195 208 } 196 209 function afterData() 197 210 { 198 var fillingChar = getFillingChar( editor.document ); 199 fillingChar && fillingChar.setText( fillingCharBefore ); 211 var doc = editor.document, 212 fillingChar = getFillingChar( doc ); 213 214 if ( fillingChar ) 215 { 216 fillingChar.setText( fillingCharBefore ); 217 218 if ( resetSelection ) 219 { 220 doc.$.defaultView.getSelection().setPosition( fillingChar.$,fillingChar.getLength() ); 221 resetSelection = 0; 222 } 223 } 200 224 } 201 225 editor.on( 'beforeUndoImage', beforeData );
Note: See TracChangeset
for help on using the changeset viewer.
