Commit 4883c260 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

При вводе текста подстановку делаем только если введено не число.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55343 954022d7-b5bf-4e40-9824-e11837661b57
parent 2bb572b6
...@@ -2127,14 +2127,16 @@ ...@@ -2127,14 +2127,16 @@
t._addChars(String.fromCharCode(event.which)); t._addChars(String.fromCharCode(event.which));
if (t.textRender.getEndOfText() === t.cursorPos && !t.isFormula()) { if (t.textRender.getEndOfText() === t.cursorPos && !t.isFormula()) {
var s = t._getFragmentsText(t.options.fragments); var s = t._getFragmentsText(t.options.fragments);
var arrAutoComplete = t._getAutoComplete(s.toLowerCase()); if (!isNumber(s)) {
var lengthInput = s.length; var arrAutoComplete = t._getAutoComplete(s.toLowerCase());
if (1 === arrAutoComplete.length) { var lengthInput = s.length;
var newValue = arrAutoComplete[0]; if (1 === arrAutoComplete.length) {
var tmpCursorPos = t.cursorPos; var newValue = arrAutoComplete[0];
t._addChars(newValue.substring(lengthInput)); var tmpCursorPos = t.cursorPos;
t.selectionBegin = tmpCursorPos; t._addChars(newValue.substring(lengthInput));
t._selectChars(kEndOfText); t.selectionBegin = tmpCursorPos;
t._selectChars(kEndOfText);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment