mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add shortcut for opening Record Card
Summary: Also adds tests for previously untested Record Card behavior. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4136
This commit is contained in:
@@ -228,7 +228,7 @@ BaseView.commonCommands = {
|
||||
this.scrollToCursor(true).catch(reportError);
|
||||
this.activateEditorAtCursor({init});
|
||||
},
|
||||
editField: function() { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
editField: function(event) { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor({event}); },
|
||||
|
||||
insertRecordBefore: function() { this.insertRow(this.cursor.rowIndex()); },
|
||||
insertRecordAfter: function() { this.insertRow(this.cursor.rowIndex() + 1); },
|
||||
@@ -243,6 +243,12 @@ BaseView.commonCommands = {
|
||||
filterByThisCellValue: function() { this.filterByThisCellValue(); },
|
||||
duplicateRows: function() { this._duplicateRows().catch(reportError); },
|
||||
openDiscussion: function() { this.openDiscussionAtCursor(); },
|
||||
viewAsCard: function() {
|
||||
/* Overridden by subclasses.
|
||||
*
|
||||
* This is still needed so that <space> doesn't trigger the `input` command
|
||||
* if a subclass doesn't support opening the current record as a card. */
|
||||
},
|
||||
};
|
||||
|
||||
BaseView.prototype.selectedRows = function() {
|
||||
|
||||
@@ -308,7 +308,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() { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor(); },
|
||||
editField: function(event) { closeRegisteredMenu(); this.scrollToCursor(true); this.activateEditorAtCursor({event}); },
|
||||
|
||||
insertFieldBefore: function(maybeKeyboardEvent) {
|
||||
if (!maybeKeyboardEvent) {
|
||||
|
||||
@@ -71,7 +71,6 @@ export type CommandName =
|
||||
| 'input'
|
||||
| 'editLabel'
|
||||
| 'editLayout'
|
||||
| 'toggleCheckbox'
|
||||
| 'historyPrevious'
|
||||
| 'historyNext'
|
||||
| 'makeFormula'
|
||||
@@ -273,7 +272,7 @@ export const groups: CommendGroupDef[] = [{
|
||||
},
|
||||
{
|
||||
name: 'viewAsCard',
|
||||
keys: [],
|
||||
keys: ['Space'],
|
||||
desc: 'Show the record card widget of the selected record',
|
||||
},
|
||||
]
|
||||
@@ -483,10 +482,6 @@ export const groups: CommendGroupDef[] = [{
|
||||
name: 'editLayout',
|
||||
keys: [],
|
||||
desc: 'Edit record layout'
|
||||
}, {
|
||||
name: 'toggleCheckbox',
|
||||
keys: ['Enter', 'Space'],
|
||||
desc: 'Toggles the value of checkbox cells'
|
||||
}, {
|
||||
name: 'historyPrevious',
|
||||
keys: ['Up'],
|
||||
|
||||
Reference in New Issue
Block a user