mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Disabling 'Add widget to page' for special pages
Summary: Disabling "Add widget to page" on special pages like acl or code Test Plan: browser tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2969
This commit is contained in:
parent
07bf250592
commit
0b11960fe7
@ -303,7 +303,8 @@ function addMenu(importSources: ImportSource[], gristDoc: GristDoc, isReadonly:
|
|||||||
(elem) => openPageWidgetPicker(elem, gristDoc.docModel, (val) => gristDoc.addWidgetToPage(val).catch(reportError),
|
(elem) => openPageWidgetPicker(elem, gristDoc.docModel, (val) => gristDoc.addWidgetToPage(val).catch(reportError),
|
||||||
{isNewPage: false, selectBy}),
|
{isNewPage: false, selectBy}),
|
||||||
menuIcon("Widget"), "Add Widget to Page", testId('dp-add-widget-to-page'),
|
menuIcon("Widget"), "Add Widget to Page", testId('dp-add-widget-to-page'),
|
||||||
dom.cls('disabled', isReadonly)
|
// disable for readonly doc and all special views
|
||||||
|
dom.cls('disabled', (use) => typeof use(gristDoc.activeViewId) !== 'number' || isReadonly),
|
||||||
),
|
),
|
||||||
menuItem(() => gristDoc.addEmptyTable().catch(reportError),
|
menuItem(() => gristDoc.addEmptyTable().catch(reportError),
|
||||||
menuIcon("TypeTable"), "Add Empty Table", testId('dp-empty-table'),
|
menuIcon("TypeTable"), "Add Empty Table", testId('dp-empty-table'),
|
||||||
|
Loading…
Reference in New Issue
Block a user