Commit a9397e52 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

fix bug #28275

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68031 954022d7-b5bf-4e40-9824-e11837661b57
parent 69d6e59c
...@@ -304,6 +304,22 @@ ...@@ -304,6 +304,22 @@
var opt = this.options, ret; var opt = this.options, ret;
if (saveValue && "function" === typeof opt.saveValueCallback) { if (saveValue && "function" === typeof opt.saveValueCallback) {
// Делаем замену текста на автодополнение, если есть select и текст полностью совпал.
if (this.selectionBegin !== this.selectionEnd && !this.isFormula()) {
var s = this._getFragmentsText(this.options.fragments);
if (!isNumber(s)) {
var arrAutoComplete = this._getAutoComplete(s.toLowerCase());
if (1 === arrAutoComplete.length) {
var newValue = arrAutoComplete[0];
this.selectionBegin = this.textRender.getBeginOfText();
this.cursorPos = this.selectionEnd = this.textRender.getEndOfText();
this.undoAllMode = true;
this._addChars(newValue);
this.undoAllMode = false;
}
}
}
ret = this._wrapFragments(opt.fragments); // восстанавливаем символы \n ret = this._wrapFragments(opt.fragments); // восстанавливаем символы \n
ret = opt.saveValueCallback(opt.fragments, this.textFlags, /*skip NL check*/ret); ret = opt.saveValueCallback(opt.fragments, this.textFlags, /*skip NL check*/ret);
if (!ret) { if (!ret) {
......
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