mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add cut, copy, and paste to context menu
Summary: On supported browsers, the new context menu commands work exactly as they do via keyboard shortcuts. On unsupported browsers, an unavailable command modal is shown with a suggestion to use keyboard shortcuts instead. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3867
This commit is contained in:
@@ -277,6 +277,7 @@ _.extend(GridView.prototype, BaseView.prototype);
|
||||
// Moved out of all commands to support Raw Data Views (which use this command to close
|
||||
// the Grid popup).
|
||||
GridView.selectionCommands = {
|
||||
clearCopySelection: function() { this._clearCopySelection(); },
|
||||
cancel: function() { this.clearSelection(); }
|
||||
}
|
||||
|
||||
@@ -455,7 +456,7 @@ GridView.prototype.paste = async function(data, cutCallback) {
|
||||
topRowIndex + outputHeight - 1, leftIndex + outputWidth - 1);
|
||||
}
|
||||
|
||||
this.copySelection(null);
|
||||
commands.allCommands.clearCopySelection.run();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1738,6 +1739,10 @@ GridView.prototype._duplicateRows = async function() {
|
||||
}
|
||||
}
|
||||
|
||||
GridView.prototype._clearCopySelection = function() {
|
||||
this.copySelection(null);
|
||||
};
|
||||
|
||||
function buildStyleOption(owner, computedRule, optionName) {
|
||||
return ko.computed(() => {
|
||||
if (owner.isDisposed()) { return null; }
|
||||
|
||||
Reference in New Issue
Block a user