Commit a73ed133 authored by Alexander.Trofimov's avatar Alexander.Trofimov

KeyDown, KeyPress, KeyUp -> text_input controller

parent 1d140ef2
...@@ -130,9 +130,6 @@ ...@@ -130,9 +130,6 @@
this.isUpdateValue = true; // Обновлять ли состояние строки при вводе в TextArea this.isUpdateValue = true; // Обновлять ли состояние строки при вводе в TextArea
// Функции, которые будем отключать // Функции, которые будем отключать
this.fKeyDown = null;
this.fKeyPress = null;
this.fKeyUp = null;
this.fKeyMouseUp = null; this.fKeyMouseUp = null;
this.fKeyMouseMove = null; this.fKeyMouseMove = null;
//----------------- //-----------------
...@@ -238,15 +235,6 @@ ...@@ -238,15 +235,6 @@
}, false ); }, false );
} }
this.fKeyDown = function ( event ) {
return t._onWindowKeyDown( event );
};
this.fKeyPress = function () {
return t._onWindowKeyPress.apply( t, arguments );
};
this.fKeyUp = function () {
return t._onWindowKeyUp.apply( t, arguments );
};
this.fKeyMouseUp = function () { this.fKeyMouseUp = function () {
return t._onWindowMouseUp.apply( t, arguments ); return t._onWindowMouseUp.apply( t, arguments );
}; };
...@@ -272,9 +260,6 @@ ...@@ -272,9 +260,6 @@
this.isOpened = true; this.isOpened = true;
if ( window.addEventListener ) { if ( window.addEventListener ) {
window.addEventListener( "keydown", this.fKeyDown, false );
window.addEventListener( "keypress", this.fKeyPress, false );
window.addEventListener( "keyup", this.fKeyUp, false );
window.addEventListener( "mouseup", this.fKeyMouseUp, false ); window.addEventListener( "mouseup", this.fKeyMouseUp, false );
window.addEventListener( "mousemove", this.fKeyMouseMove, false ); window.addEventListener( "mousemove", this.fKeyMouseMove, false );
} }
...@@ -351,9 +336,6 @@ ...@@ -351,9 +336,6 @@
if ( !window['IS_NATIVE_EDITOR'] ) { if ( !window['IS_NATIVE_EDITOR'] ) {
if ( window.removeEventListener ) { if ( window.removeEventListener ) {
window.removeEventListener( "keydown", this.fKeyDown, false );
window.removeEventListener( "keypress", this.fKeyPress, false );
window.removeEventListener( "keyup", this.fKeyUp, false );
window.removeEventListener( "mouseup", this.fKeyMouseUp, false ); window.removeEventListener( "mouseup", this.fKeyMouseUp, false );
window.removeEventListener( "mousemove", this.fKeyMouseMove, false ); window.removeEventListener( "mousemove", this.fKeyMouseMove, false );
} }
......
...@@ -132,9 +132,6 @@ ...@@ -132,9 +132,6 @@
// initialize events // initialize events
if (window.addEventListener) { if (window.addEventListener) {
window.addEventListener("resize" , function () {self._onWindowResize.apply(self, arguments);} , false); window.addEventListener("resize" , function () {self._onWindowResize.apply(self, arguments);} , false);
window.addEventListener("keydown" , function () {return self._onWindowKeyDown.apply(self, arguments);} , false);
window.addEventListener("keypress" , function () {return self._onWindowKeyPress.apply(self, arguments);} , false);
window.addEventListener("keyup" , function () {return self._onWindowKeyUp.apply(self, arguments);} , false);
window.addEventListener("mousemove" , function () {return self._onWindowMouseMove.apply(self, arguments);} , false); window.addEventListener("mousemove" , function () {return self._onWindowMouseMove.apply(self, arguments);} , false);
window.addEventListener("mouseup" , function () {return self._onWindowMouseUp.apply(self, arguments);} , false); window.addEventListener("mouseup" , function () {return self._onWindowMouseUp.apply(self, arguments);} , false);
window.addEventListener("mouseleave", function () {return self._onWindowMouseLeaveOut.apply(self, arguments);} , false); window.addEventListener("mouseleave", function () {return self._onWindowMouseLeaveOut.apply(self, arguments);} , false);
......
...@@ -270,15 +270,12 @@ ...@@ -270,15 +270,12 @@
this._canResize(); this._canResize();
// Shapes // Shapes
var canvasWidth = this.drawingGraphicCtx.canvas.width; var canvasWidth = this.drawingGraphicCtx.canvas.width;
var canvasHeight = this.drawingGraphicCtx.canvas.height; var canvasHeight = this.drawingGraphicCtx.canvas.height;
this.buffers.shapeCtx = new AscCommon.CGraphics(); this.buffers.shapeCtx = new AscCommon.CGraphics();
this.buffers.shapeCtx.init(this.drawingGraphicCtx.ctx, canvasWidth, canvasHeight, (canvasWidth * 25.4 / this.drawingGraphicCtx.ppiX), (canvasHeight * 25.4 / this.drawingGraphicCtx.ppiY)); this.buffers.shapeCtx.init(this.drawingGraphicCtx.ctx, canvasWidth, canvasHeight, (canvasWidth * 25.4 / this.drawingGraphicCtx.ppiX), (canvasHeight * 25.4 / this.drawingGraphicCtx.ppiY));
this.buffers.shapeCtx.m_oFontManager = this.fmgrGraphics[2]; this.buffers.shapeCtx.m_oFontManager = this.fmgrGraphics[2];
var overlayWidth = this.overlayGraphicCtx.canvas.width; var overlayWidth = this.overlayGraphicCtx.canvas.width;
var overlayHeight = this.overlayGraphicCtx.canvas.height; var overlayHeight = this.overlayGraphicCtx.canvas.height;
this.buffers.shapeOverlayCtx = new AscCommon.CGraphics(); this.buffers.shapeOverlayCtx = new AscCommon.CGraphics();
...@@ -527,7 +524,20 @@ ...@@ -527,7 +524,20 @@
}, /*settings*/{ }, /*settings*/{
font: this.defaultFont, padding: this.defaults.worksheetView.cells.padding font: this.defaultFont, padding: this.defaults.worksheetView.cells.padding
}); });
this.Api.onKeyDown = function (event) {
var listener = self.isCellEditMode ? self.cellEditor : self.controller;
listener._onWindowKeyDown(event);
};
this.Api.onKeyPress = function (event) {
var listener = self.isCellEditMode ? self.cellEditor : self.controller;
listener._onWindowKeyPress(event);
};
this.Api.onKeyUp = function (event) {
var listener = self.isCellEditMode ? self.cellEditor : self.controller;
listener._onWindowKeyUp(event);
};
AscCommon.InitBrowserInputContext(this.Api, "id_target_cursor");
this.wsViewHandlers = new AscCommonExcel.asc_CHandlersList(/*handlers*/{ this.wsViewHandlers = new AscCommonExcel.asc_CHandlersList(/*handlers*/{
"getViewerMode": function() { "getViewerMode": function() {
......
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