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

add asc_showAutoComplete

parent b5128f1f
......@@ -2857,6 +2857,10 @@ var editor;
}
};
spreadsheet_api.prototype.asc_showAutoComplete = function() {
this.wb.showAutoComplete();
};
spreadsheet_api.prototype.asc_onMouseUp = function(event, x, y) {
this.controller._onWindowMouseUpExternal(event, x, y);
};
......@@ -3554,6 +3558,7 @@ var editor;
prot["asc_increaseFontSize"] = prot.asc_increaseFontSize;
prot["asc_decreaseFontSize"] = prot.asc_decreaseFontSize;
prot["asc_formatPainter"] = prot.asc_formatPainter;
prot["asc_showAutoComplete"] = prot.asc_showAutoComplete;
prot["asc_onMouseUp"] = prot.asc_onMouseUp;
......
......@@ -2599,62 +2599,61 @@
};
/** @param event {MouseEvent} */
CellEditor.prototype._onWindowMouseMove = function ( event ) {
if ( c_oAscCellEditorSelectState.no !== this.isSelectMode && !this.hasCursor ) {
this._changeSelection( this._getCoordinates( event ) );
CellEditor.prototype._onWindowMouseMove = function (event) {
if (c_oAscCellEditorSelectState.no !== this.isSelectMode && !this.hasCursor) {
this._changeSelection(this._getCoordinates(event));
}
return true;
};
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseDown = function ( event ) {
if (AscCommon.g_inputContext)
CellEditor.prototype._onMouseDown = function (event) {
if (AscCommon.g_inputContext) {
AscCommon.g_inputContext.externalChangeFocus();
}
var pos;
var coord = this._getCoordinates( event );
if ( !window['IS_NATIVE_EDITOR'] ) {
this.clickCounter.mouseDownEvent( coord.x, coord.y, event.button );
var coord = this._getCoordinates(event);
if (!window['IS_NATIVE_EDITOR']) {
this.clickCounter.mouseDownEvent(coord.x, coord.y, event.button);
}
this.setFocus( true );
this.setFocus(true);
this.isTopLineActive = false;
this.input.isFocused = false;
if ( 0 === event.button ) {
if ( 1 === this.clickCounter.getClickCount() % 2 ) {
if (0 === event.button) {
if (1 === this.clickCounter.getClickCount() % 2) {
this.isSelectMode = c_oAscCellEditorSelectState.char;
if ( !event.shiftKey ) {
if (!event.shiftKey) {
this._showCursor();
pos = this._findCursorPosition( coord );
if ( pos !== undefined ) {
pos >= 0 ? this._moveCursor( kPosition, pos ) : this._moveCursor( pos );
pos = this._findCursorPosition(coord);
if (pos !== undefined) {
pos >= 0 ? this._moveCursor(kPosition, pos) : this._moveCursor(pos);
}
} else {
this._changeSelection(coord);
}
else {
this._changeSelection( coord );
}
}
else {
} else {
// Dbl click
this.isSelectMode = c_oAscCellEditorSelectState.word;
// Окончание слова
var endWord = this.textRender.getNextWord( this.cursorPos );
var endWord = this.textRender.getNextWord(this.cursorPos);
// Начало слова (ищем по окончанию, т.к. могли попасть в пробел)
var startWord = this.textRender.getPrevWord( endWord );
var startWord = this.textRender.getPrevWord(endWord);
this._moveCursor( kPosition, startWord );
this._selectChars( kPosition, endWord );
this._moveCursor(kPosition, startWord);
this._selectChars(kPosition, endWord);
}
}
return true;
};
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseUp = function ( event ) {
if ( 2 === event.button ) {
this.handlers.trigger( 'onContextMenu', event );
CellEditor.prototype._onMouseUp = function (event) {
if (2 === event.button) {
this.handlers.trigger('onContextMenu', event);
return true;
}
this.isSelectMode = c_oAscCellEditorSelectState.no;
......
......@@ -68,7 +68,7 @@
var c_oAscAsyncAction = asc.c_oAscAsyncAction;
var c_oAscFontRenderingModeType = asc.c_oAscFontRenderingModeType;
var c_oAscAsyncActionType = asc.c_oAscAsyncActionType;
function WorkbookCommentsModel(handlers, aComments) {
this.workbook = {handlers: handlers};
......@@ -443,7 +443,7 @@
// AutoComplete
"showAutoComplete": function () {
self._onShowAutoComplete.apply(self, arguments);
self.showAutoComplete.apply(self, arguments);
}, "onContextMenu": function (event) {
self.handlers.trigger("asc_onContextMenu", event);
},
......@@ -806,7 +806,7 @@
}
this.clipboard.Api = this.Api;
this.initFormulasList();
this.fReplaceCallback = function() {
......@@ -1191,7 +1191,7 @@
ws.applyFrozenAnchor(x, y, target);
};
WorkbookView.prototype._onShowAutoComplete = function() {
WorkbookView.prototype.showAutoComplete = function() {
var ws = this.getWorksheet();
var arrValues = ws.getCellAutoCompleteValues(ws.model.selectionRange.activeCell);
this.handlers.trigger('asc_onEntriesListMenu', arrValues);
......@@ -2005,7 +2005,7 @@
WorkbookView.prototype.bIsEmptyClipboard = function() {
return this.clipboard.bIsEmptyClipboard(this.getCellEditMode());
};
WorkbookView.prototype.checkCopyToClipboard = function(_clipboard, _formats) {
var t = this, ws;
ws = t.getWorksheet();
......
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