1
0
Fork 0
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:
Harvey Kandola 2017-01-24 10:15:16 -08:00
parent 03402d9e4d
commit 17b01c2de4
3 changed files with 44 additions and 38 deletions

View file

@ -12,16 +12,20 @@
import Ember from 'ember'; import Ember from 'ember';
import NotifierMixin from '../../mixins/notifier'; import NotifierMixin from '../../mixins/notifier';
const {
computed,
} = Ember;
export default Ember.Component.extend(NotifierMixin, { export default Ember.Component.extend(NotifierMixin, {
display: 'section', // which CSS to use display: 'section', // which CSS to use
hasTemplates: false, hasTemplates: false,
hasBlocks: false,
blockMode: false,
didReceiveAttrs() { didReceiveAttrs() {
let blocks = this.get('blocks'); 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); this.set('hasBlocks', blocks.get('length') > 0);

View file

@ -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')}}

View file

@ -19,6 +19,7 @@
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
{{#if blockMode}}
{{#if hasBlocks}} {{#if hasBlocks}}
<div class="divider"></div> <div class="divider"></div>
<div class="template-caption">Reusable content</div> <div class="template-caption">Reusable content</div>
@ -55,5 +56,6 @@
<div class="divider"></div> <div class="divider"></div>
<div class="template-caption">Reusable content appears below</div> <div class="template-caption">Reusable content appears below</div>
{{/if}} {{/if}}
{{/if}}
</div> </div>
</div> </div>