mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Show default context menu on link
Summary: also: - closes opened menu if any when click on a custom widget - closes opened menu if any when F2 Test Plan: Include test case Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3269
This commit is contained in:
@@ -22,6 +22,7 @@ const {copyToClipboard} = require('app/client/lib/copyToClipboard');
|
||||
const {setTestState} = require('app/client/lib/testState');
|
||||
const {ExtraRows} = require('app/client/models/DataTableModelWithDiff');
|
||||
const {createFilterMenu} = require('app/client/ui/ColumnFilterMenu');
|
||||
const {closeRegisteredMenu} = require('app/client/ui2018/menus');
|
||||
|
||||
/**
|
||||
* BaseView forms the basis for ViewSection classes.
|
||||
@@ -219,7 +220,7 @@ BaseView.commonCommands = {
|
||||
this.scrollToCursor(true).catch(reportError);
|
||||
this.activateEditorAtCursor({init});
|
||||
},
|
||||
editField: function() { this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
editField: function() { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
|
||||
insertRecordBefore: function() { this.insertRow(this.cursor.rowIndex()); },
|
||||
insertRecordAfter: function() { this.insertRow(this.cursor.rowIndex() + 1); },
|
||||
|
||||
@@ -20,6 +20,7 @@ import {dom as grains} from 'grainjs';
|
||||
import * as ko from 'knockout';
|
||||
import defaults = require('lodash/defaults');
|
||||
import {AccessLevel} from 'app/common/CustomWidget';
|
||||
import {closeRegisteredMenu} from 'app/client/ui2018/menus';
|
||||
|
||||
/**
|
||||
* CustomView components displays arbitrary html. There are two modes available, in the "url" mode
|
||||
@@ -218,6 +219,8 @@ export class CustomView extends Disposable {
|
||||
if (!this.viewSection.isDisposed() && !this.viewSection.hasFocus()) {
|
||||
this.viewSection.hasFocus(true);
|
||||
}
|
||||
// allow menus to close if any
|
||||
closeRegisteredMenu();
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const {onDblClickMatchElem} = require('app/client/lib/dblclick');
|
||||
|
||||
// Grist UI Components
|
||||
const {dom: grainjsDom, Holder, Computed} = require('grainjs');
|
||||
const {menu} = require('../ui2018/menus');
|
||||
const {closeRegisteredMenu, menu} = require('../ui2018/menus');
|
||||
const {calcFieldsCondition} = require('../ui/GridViewMenus');
|
||||
const {ColumnAddMenu, ColumnContextMenu, MultiColumnMenu, freezeAction} = require('../ui/GridViewMenus');
|
||||
const {RowContextMenu} = require('../ui/RowContextMenu');
|
||||
@@ -273,7 +273,7 @@ GridView.gridCommands = {
|
||||
|
||||
fieldEditSave: function() { this.cursor.rowIndex(this.cursor.rowIndex() + 1); },
|
||||
// Re-define editField after fieldEditSave to make it take precedence for the Enter key.
|
||||
editField: function() { this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
editField: function() { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
|
||||
deleteRecords: function() {
|
||||
const saved = this.cursor.getCursorPos();
|
||||
|
||||
Reference in New Issue
Block a user