mirror of
https://github.com/documize/community.git
synced 2025-07-29 01:59:41 +02:00
detecte non-block mode and hide messaging
This commit is contained in:
parent
03402d9e4d
commit
17b01c2de4
3 changed files with 44 additions and 38 deletions
|
@ -12,16 +12,20 @@
|
|||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
display: 'section', // which CSS to use
|
||||
hasTemplates: false,
|
||||
hasBlocks: false,
|
||||
blockMode: false,
|
||||
|
||||
didReceiveAttrs() {
|
||||
let blocks = this.get('blocks');
|
||||
let blockMode = is.not.undefined(blocks);
|
||||
|
||||
this.set('blockMode', blockMode);
|
||||
if (!blockMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('hasBlocks', blocks.get('length') > 0);
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAction=(action 'onAddSection')}}
|
||||
{{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAddSection=(action 'onAddSection')}}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{#if blockMode}}
|
||||
{{#if hasBlocks}}
|
||||
<div class="divider"></div>
|
||||
<div class="template-caption">Reusable content</div>
|
||||
|
@ -55,5 +56,6 @@
|
|||
<div class="divider"></div>
|
||||
<div class="template-caption">Reusable content appears below</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue