Commit e1c3da8b 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@57603 954022d7-b5bf-4e40-9824-e11837661b57
parent face4f90
......@@ -290,6 +290,63 @@
"isPopUpSelectorOpen": function () {return self.popUpSelector.getVisible();}
});
if (this.input && this.input.addEventListener) {
this.input.addEventListener("focus", function () {
self.input.isFocused = true;
if (self.controller.settings.isViewerMode) {
return;
}
self.controller.setStrictClose(true);
self.cellEditor.callTopLineMouseup = true;
if (!self.controller.isCellEditMode && !self.controller.isFillHandleMode) {
self._onEditCell(0, 0, /*isCoord*/false, /*isFocus*/true);
}
}, false);
}
this.cellEditor = new asc_CE(this.element, this.input, this.fmgrGraphics, this.m_oFont,
/*handlers*/{
"closed" : function () {self._onCloseCellEditor.apply(self, arguments);},
"updated" : function () {self._onUpdateCellEditor.apply(self, arguments);},
"gotFocus" : function (hasFocus) {self.controller.setFocus(!hasFocus);},
"copy" : function () {self.copyToClipboard.apply(self, arguments);},
"paste" : function () {self.pasteFromClipboard.apply(self, arguments);},
"cut" : function () {self.cutToClipboard.apply(self, arguments);},
"updateFormulaEditMod": function () {
self.controller.setFormulaEditMode.apply(self.controller, arguments);
var ws = self.getWorksheet();
if (ws) {
ws.cleanSelection();
ws.cleanFormulaRanges();
ws.setFormulaEditMode.apply(ws, arguments);
}
},
"updateEditorState" : function () {self.handlers.trigger.apply(self.handlers,
["asc_onEditCell"].concat(Array.prototype.slice.call(arguments)));},
"isGlobalLockEditCell" : function () {return self.collaborativeEditing.getGlobalLockEditCell();},
"updateFormulaEditModEnd": function (rangeUpdated) {
self.getWorksheet().updateSelection();
},
"newRange" : function (range) { self.getWorksheet().addFormulaRange(range); },
"existedRange" : function (range) { self.getWorksheet().changeFormulaRange(range); },
"updateUndoRedoChanged" : function (bCanUndo, bCanRedo) {
self.handlers.trigger("asc_onCanUndoChanged", bCanUndo);
self.handlers.trigger("asc_onCanRedoChanged", bCanRedo);
},
"applyCloseEvent" : function () {self.controller._onWindowKeyDown.apply(self.controller, arguments);},
"isViewerMode" : function () {return self.controller.settings.isViewerMode;},
"popUpSelectorKeyDown" : function (event) {return self._onPopUpSelectorKeyDown(event);},
"getFormulaRanges" : function () {return self.getWorksheet().getFormulaRanges();}
},
/*settings*/{
font: this.defaultFont
});
this.popUpSelector = new asc_PS(this.element, /*handlers*/{
"insert" : function () {self._onPopUpSelectorInsert.apply(self, arguments);}
});
}
this.model.handlers.add("cleanCellCache", function (wsId, range, canChangeColWidth, bLockDraw) {
var ws = self.getWorksheetById(wsId);
if (ws)
......@@ -396,64 +453,6 @@
self.handlers.trigger("asc_onSheetsChanged");
});
if (this.input && this.input.addEventListener) {
this.input.addEventListener("focus", function () {
self.input.isFocused = true;
if (self.controller.settings.isViewerMode) {
return;
}
self.controller.setStrictClose(true);
self.cellEditor.callTopLineMouseup = true;
if (!self.controller.isCellEditMode && !self.controller.isFillHandleMode) {
self._onEditCell(0, 0, /*isCoord*/false, /*isFocus*/true);
}
}, false);
}
this.cellEditor = new asc_CE(this.element, this.input, this.fmgrGraphics, this.m_oFont,
/*handlers*/{
"closed" : function () {self._onCloseCellEditor.apply(self, arguments);},
"updated" : function () {self._onUpdateCellEditor.apply(self, arguments);},
"gotFocus" : function (hasFocus) {self.controller.setFocus(!hasFocus);},
"copy" : function () {self.copyToClipboard.apply(self, arguments);},
"paste" : function () {self.pasteFromClipboard.apply(self, arguments);},
"cut" : function () {self.cutToClipboard.apply(self, arguments);},
"updateFormulaEditMod": function () {
self.controller.setFormulaEditMode.apply(self.controller, arguments);
var ws = self.getWorksheet();
if (ws) {
ws.cleanSelection();
ws.cleanFormulaRanges();
ws.setFormulaEditMode.apply(ws, arguments);
}
},
"updateEditorState" : function () {self.handlers.trigger.apply(self.handlers,
["asc_onEditCell"].concat(Array.prototype.slice.call(arguments)));},
"isGlobalLockEditCell" : function () {return self.collaborativeEditing.getGlobalLockEditCell();},
"updateFormulaEditModEnd": function (rangeUpdated) {
self.getWorksheet().updateSelection();
},
"newRange" : function (range) { self.getWorksheet().addFormulaRange(range); },
"existedRange" : function (range) { self.getWorksheet().changeFormulaRange(range); },
"updateUndoRedoChanged" : function (bCanUndo, bCanRedo) {
self.handlers.trigger("asc_onCanUndoChanged", bCanUndo);
self.handlers.trigger("asc_onCanRedoChanged", bCanRedo);
},
"applyCloseEvent" : function () {self.controller._onWindowKeyDown.apply(self.controller, arguments);},
"isViewerMode" : function () {return self.controller.settings.isViewerMode;},
"popUpSelectorKeyDown" : function (event) {return self._onPopUpSelectorKeyDown(event);},
"getFormulaRanges" : function () {return self.getWorksheet().getFormulaRanges();}
},
/*settings*/{
font: this.defaultFont
});
this.popUpSelector = new asc_PS(this.element, /*handlers*/{
"insert" : function () {self._onPopUpSelectorInsert.apply(self, arguments);}
});
}
this.cellCommentator = new CCellCommentator({
model: new WorkbookCommentsModel(this.handlers),
collaborativeEditing: this.collaborativeEditing,
......
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