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

Поправил баг http://bugzserver/show_bug.cgi?id=24272

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57625 954022d7-b5bf-4e40-9824-e11837661b57
parent f6295cd4
...@@ -268,15 +268,15 @@ ...@@ -268,15 +268,15 @@
}; };
CellEditor.prototype.close = function (saveValue) { CellEditor.prototype.close = function (saveValue) {
var t = this, opt = t.options, ret = false; var opt = this.options, ret;
if (saveValue && "function" === typeof opt.saveValueCallback) { if (saveValue && "function" === typeof opt.saveValueCallback) {
ret = t._wrapFragments(opt.fragments); // восстанавливаем символы \n ret = this._wrapFragments(opt.fragments); // восстанавливаем символы \n
ret = opt.saveValueCallback(opt.fragments, t.textFlags, /*skip NL check*/ret); ret = opt.saveValueCallback(opt.fragments, this.textFlags, /*skip NL check*/ret);
if (!ret) {return false;} if (!ret) {return false;}
} }
t.isOpened = false; this.isOpened = false;
if (window.removeEventListener) { if (window.removeEventListener) {
window.removeEventListener("keydown" , this.fKeyDown , false); window.removeEventListener("keydown" , this.fKeyDown , false);
window.removeEventListener("keypress" , this.fKeyPress , false); window.removeEventListener("keypress" , this.fKeyPress , false);
...@@ -284,19 +284,19 @@ ...@@ -284,19 +284,19 @@
window.removeEventListener("mouseup" , this.fKeyMouseUp , false); window.removeEventListener("mouseup" , this.fKeyMouseUp , false);
window.removeEventListener("mousemove" , this.fKeyMouseMove, false); window.removeEventListener("mousemove" , this.fKeyMouseMove, false);
} }
t.input.blur(); this.input.blur();
t.isTopLineActive = false; this.isTopLineActive = false;
t.input.isFocused = false; this.input.isFocused = false;
t._hideCursor(); this._hideCursor();
// hide // hide
t.canvasOuterStyle.display = "none"; this._hideCanvas();
// delete autoComplete // delete autoComplete
this.objAutoComplete = {}; this.objAutoComplete = {};
// Сброс состояния редактора // Сброс состояния редактора
this.m_nEditorState = c_oAscCellEditorState.editEnd; this.m_nEditorState = c_oAscCellEditorState.editEnd;
t.handlers.trigger("closed"); this.handlers.trigger("closed");
return true; return true;
}; };
...@@ -444,11 +444,11 @@ ...@@ -444,11 +444,11 @@
if (this.left < l || this.top < t || this.left > r || this.top > b) { if (this.left < l || this.top < t || this.left > r || this.top > b) {
// hide // hide
this.canvasOuterStyle.display = 'none'; this._hideCanvas();
} else { } else {
this.canvasOuterStyle.display = 'block';
// ToDo выставлять опции (т.к. при scroll редактор должен пересчитываться и уменьшаться размеры) // ToDo выставлять опции (т.к. при scroll редактор должен пересчитываться и уменьшаться размеры)
this._adjustCanvas(); this._adjustCanvas();
this._showCanvas();
this._renderText(); this._renderText();
this._drawSelection(); this._drawSelection();
} }
...@@ -848,6 +848,7 @@ ...@@ -848,6 +848,7 @@
this._cleanText(); this._cleanText();
this._cleanSelection(); this._cleanSelection();
this._adjustCanvas(); this._adjustCanvas();
this._showCanvas();
this._renderText(); this._renderText();
this.input.value = this._getFragmentsText(fragments); this.input.value = this._getFragmentsText(fragments);
this._updateCursorPosition(); this._updateCursorPosition();
...@@ -978,13 +979,19 @@ ...@@ -978,13 +979,19 @@
this.drawingCtx.clear(); this.drawingCtx.clear();
}; };
CellEditor.prototype._showCanvas = function () {
this.canvasOuterStyle.display = 'block';
};
CellEditor.prototype._hideCanvas = function () {
this.canvasOuterStyle.display = 'none';
};
CellEditor.prototype._adjustCanvas = function () { CellEditor.prototype._adjustCanvas = function () {
var t = this; var z = this.defaults.canvasZIndex;
var z = t.defaults.canvasZIndex; var left = this.left * this.kx;
var left = t.left * t.kx; var top = this.top * this.ky;
var top = t.top * t.ky; var widthStyle = (this.right - this.left) * this.kx - 1; // ToDo разобраться с '-1'
var widthStyle = (t.right - t.left) * t.kx - 1; // ToDo разобраться с '-1' var heightStyle = (this.bottom - this.top) * this.ky - 1;
var heightStyle = (t.bottom - t.top) * t.ky - 1;
var isRetina = AscBrowser.isRetina; var isRetina = AscBrowser.isRetina;
var width = widthStyle, height = heightStyle; var width = widthStyle, height = heightStyle;
...@@ -996,21 +1003,18 @@ ...@@ -996,21 +1003,18 @@
heightStyle >>= 1; heightStyle >>= 1;
} }
t.canvasOuterStyle.left = left + 'px'; this.canvasOuterStyle.left = left + 'px';
t.canvasOuterStyle.top = top + 'px'; this.canvasOuterStyle.top = top + 'px';
t.canvasOuterStyle.width = widthStyle + 'px'; this.canvasOuterStyle.width = widthStyle + 'px';
t.canvasOuterStyle.height = heightStyle + 'px'; this.canvasOuterStyle.height = heightStyle + 'px';
t.canvasOuterStyle.zIndex = t.top <= 0 ? -1 : z; this.canvasOuterStyle.zIndex = this.top <= 0 ? -1 : z;
t.canvas.width = t.canvasOverlay.width = width; this.canvas.width = this.canvasOverlay.width = width;
t.canvas.height = t.canvasOverlay.height = height; this.canvas.height = this.canvasOverlay.height = height;
if (isRetina) { if (isRetina) {
t.canvas.style.width = t.canvasOverlay.style.width = widthStyle + 'px'; this.canvas.style.width = this.canvasOverlay.style.width = widthStyle + 'px';
t.canvas.style.height = t.canvasOverlay.style.height = heightStyle + 'px'; this.canvas.style.height = this.canvasOverlay.style.height = heightStyle + 'px';
} }
// show
t.canvasOuterStyle.display = 'block';
}; };
CellEditor.prototype._renderText = function (dy) { CellEditor.prototype._renderText = function (dy) {
......
...@@ -332,10 +332,10 @@ ...@@ -332,10 +332,10 @@
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
* @param {Woorksheet} model Worksheet * @param {Woorksheet} model Worksheet
* @param {Object} handlers Event handlers * @param {Object} handlers Event handlers
* @param {Array} buffers DrawingContext + Overlay * @param {Object} buffers DrawingContext + Overlay
* @param {StringRender} stringRender StringRender * @param {StringRender} stringRender StringRender
* @param {Number} maxDigitWidth Максимальный размер цифры * @param {Number} maxDigitWidth Максимальный размер цифры
* @param {asc.CCollaborativeEditing} collaborativeEditing * @param {CCollaborativeEditing} collaborativeEditing
* @param {Object} settings Settings * @param {Object} settings Settings
* *
* @constructor * @constructor
......
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