[ACA-1544] extensions: toolbar separators and menus (#504)

* toolbar separators

* remove the need for "target" for separators

* simplify code

* menu stub, reducing separators

* toolbar action component

* render menu items

* menu items
This commit is contained in:
Denys Vuika
2018-07-10 20:39:07 +01:00
committed by GitHub
parent 64b0790a0d
commit ad9ce9e88f
14 changed files with 343 additions and 129 deletions

View File

@@ -83,7 +83,8 @@ export abstract class PageComponent implements OnInit, OnDestroy {
if (selection.isEmpty) {
this.infoDrawerOpened = false;
}
this.actions = this.extensions.getSelectedContentActions(selection, this.node);
const selectedNodes = selection ? selection.nodes : null;
this.actions = this.extensions.getAllowedContentActions(selectedNodes, this.node);
this.canUpdateFile = this.selection.file && this.content.canUpdateNode(selection.file);
this.canUpdateNode = this.selection.count === 1 && this.content.canUpdateNode(selection.first);
this.canDelete = !this.selection.isEmpty && this.content.canDeleteNodes(selection.nodes);