82 | | // If the offset is after the last char, IE creates the text node |
83 | | // on split, but don't include it into the DOM. So, we have to do |
84 | | // that manually here. |
85 | | if ( CKEDITOR.env.ie && offset == this.getLength() ) |
86 | | { |
87 | | var next = this.getDocument().createText( '' ); |
88 | | next.insertAfter( this ); |
89 | | return next; |
90 | | } |
| 82 | function standard( offset ) { |
| 83 | |
| 84 | // If the offset is after the last char, IE creates the text node |
| 85 | // on split, but don't include it into the DOM. So, we have to do |
| 86 | // that manually here. |
| 87 | if (CKEDITOR.env.ie && offset == this.getLength()) |
| 88 | { |
| 89 | var next = this.getDocument().createText(''); |
| 90 | next.insertAfter(this); |
| 91 | return next; |
| 92 | } |
95 | | // IE BUG: IE8 does not update the childNodes array in DOM after splitText(), |
96 | | // we need to make some DOM changes to make it update. (#3436) |
97 | | if ( CKEDITOR.env.ie && CKEDITOR.env.version >= 8 ) |
98 | | { |
99 | | var workaround = new CKEDITOR.dom.text( '', doc ); |
100 | | workaround.insertAfter( retval ); |
101 | | workaround.remove(); |
102 | | } |
103 | | |
104 | | return retval; |
105 | | }, |
| 98 | // IE8 is buggy with splitText. |
| 99 | function supportSplitText() |
| 100 | { |
| 101 | return Object.prototype.toString.call( self.JSON ) != "[object JSON]"; |
| 102 | } |
| 103 | |
| 104 | if ( supportSplitText() ) |
| 105 | return standard; |
| 106 | else |
| 107 | return function( offset ) |
| 108 | { |
| 109 | var retval = standard.call( this, offset ); |
| 110 | // IE BUG: IE8 does not update the childNodes array in DOM after splitText(), |
| 111 | // we need to make some DOM changes to make it update. (#3436) |
| 112 | var workaround = this.getDocument().createText( '' ); |
| 113 | workaround.insertAfter( retval ); |
| 114 | workaround.remove(); |
| 115 | return retval; |
| 116 | }; |
| 117 | } )(), |