mirror of
https://github.com/documize/community.git
synced 2025-07-20 05:39:42 +02:00
Detect and hide empty doc toolbar
This commit is contained in:
parent
c1d796e6bc
commit
ca213ba5d1
3 changed files with 815 additions and 806 deletions
1540
embed/bindata.go
1540
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,13 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}),
|
}),
|
||||||
|
hasToolbar: computed('permissions', 'showRevisions', 'showActivity', function() {
|
||||||
|
if (this.get('showRevisions') || this.get('showActivity')) return true;
|
||||||
|
if (this.get('permissions.documentAdd') || this.get('permissions.documentDelete')) return true;
|
||||||
|
if (this.get('appMeta.edition') === this.get('constants').Product.EnterpriseEdition &&
|
||||||
|
this.get('permissions.documentEdit')) return true;
|
||||||
|
|
||||||
|
}),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -149,7 +156,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
||||||
|
|
||||||
onExport() {
|
onExport() {
|
||||||
let spec = {
|
let spec = {
|
||||||
spaceId: this.get('document.folderId'),
|
spaceId: this.get('document.spaceId'),
|
||||||
data: [],
|
data: [],
|
||||||
filterType: 'document',
|
filterType: 'document',
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/ui/ui-toolbar}}
|
{{/ui/ui-toolbar}}
|
||||||
|
|
||||||
|
{{#if hasToolbar}}
|
||||||
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
|
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
|
||||||
{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
|
{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
|
||||||
{{#if permissions.documentEdit}}
|
{{#if permissions.documentEdit}}
|
||||||
|
@ -66,6 +67,7 @@
|
||||||
tooltip="Delete" onClick=(action "onShowDeleteModal")}}
|
tooltip="Delete" onClick=(action "onShowDeleteModal")}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/ui/ui-toolbar}}
|
{{/ui/ui-toolbar}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="document-template-modal" class="modal" tabindex="-1" role="dialog">
|
<div id="document-template-modal" class="modal" tabindex="-1" role="dialog">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue