diff --git a/src/mixins/itext_behavior.mixin.js b/src/mixins/itext_behavior.mixin.js index cb4053f685f..74351d4213c 100644 --- a/src/mixins/itext_behavior.mixin.js +++ b/src/mixins/itext_behavior.mixin.js @@ -226,7 +226,7 @@ index++; } } - while (/\S/.test(this._text[index]) && index < this.text.length) { + while (/\S/.test(this._text[index]) && index < this._text.length) { offset++; index++; } @@ -258,7 +258,7 @@ findLineBoundaryRight: function(startFrom) { var offset = 0, index = startFrom; - while (!/\n/.test(this._text[index]) && index < this.text.length) { + while (!/\n/.test(this._text[index]) && index < this._text.length) { offset++; index++; } @@ -273,13 +273,13 @@ * @return {Number} Index of the beginning or end of a word */ searchWordBoundary: function(selectionStart, direction) { - var index = this._reSpace.test(this.text.charAt(selectionStart)) ? selectionStart - 1 : selectionStart, - _char = this.text.charAt(index), + var index = this._reSpace.test(this._text[selectionStart]) ? selectionStart - 1 : selectionStart, + _char = this._text[index], reNonWord = /[ \n\.,;!\?\-]/; - while (!reNonWord.test(_char) && index > 0 && index < this.text.length) { + while (!reNonWord.test(_char) && index > 0 && index < this._text.length) { index += direction; - _char = this.text.charAt(index); + _char = this._text[index]; } if (reNonWord.test(_char) && _char !== '\n') { index += direction === 1 ? 0 : 1;