diff --git a/app/app/components/document/page-wizard.js b/app/app/components/document/page-wizard.js index 87536103..7c8848da 100644 --- a/app/app/components/document/page-wizard.js +++ b/app/app/components/document/page-wizard.js @@ -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); diff --git a/app/app/pods/document/wizard/template.hbs b/app/app/pods/document/wizard/template.hbs index a5bc3dfd..37c5e05b 100644 --- a/app/app/pods/document/wizard/template.hbs +++ b/app/app/pods/document/wizard/template.hbs @@ -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')}} diff --git a/app/app/templates/components/document/page-wizard.hbs b/app/app/templates/components/document/page-wizard.hbs index 2ae1bbdf..b8ace7e1 100644 --- a/app/app/templates/components/document/page-wizard.hbs +++ b/app/app/templates/components/document/page-wizard.hbs @@ -19,41 +19,43 @@ {{/each}} - {{#if hasBlocks}} -
-
Reusable content
- - {{else}} -
-
Reusable content appears below
+
+ {{#dropdown-dialog target=block.deleteId position="bottom left" button="Delete" color="flat-red" onAction=(action 'onDeleteBlock' block.id)}} +

+ Are you sure you want to delete block
+ {{block.title}}? +

+ {{/dropdown-dialog}} + + {{/each}} + + {{else}} +
+
Reusable content appears below
+ {{/if}} {{/if}}