1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

Hide PlantUML sample diagrams when you have content

Closes #346
This commit is contained in:
HarveyKandola 2019-12-06 10:13:15 +00:00
parent 51a25adbdb
commit 5aaa9f874d
2 changed files with 29 additions and 25 deletions

View file

@ -30,6 +30,9 @@ export default Component.extend({
let page = this.get('page'); let page = this.get('page');
return `plantuml-preview-${page.id}`; return `plantuml-preview-${page.id}`;
}), }),
emptyDiagram: computed('diagramText', function () {
return _.isEmpty(this.get('diagramText'));
}),
generatePreview() { generatePreview() {
this.set('waiting', true); this.set('waiting', true);

View file

@ -10,7 +10,10 @@
<div class="form-group"> <div class="form-group">
<label><a href="http://plantuml.com/" target="_blank">PlantUML Diagram</a></label> <label><a href="http://plantuml.com/" target="_blank">PlantUML Diagram</a></label>
<Ui::UiSpacer @size="200" /> <Ui::UiSpacer @size="200" />
{{focus-textarea value=diagramText rows=30 id=editorId class="diagram-editor form-control mousetrap"}}
{{#if emptyDiagram}}
<div> <div>
<Ui::UiSpacer @size="100" />
<p>Insert sample diagrams:</p> <p>Insert sample diagrams:</p>
<p> <p>
{{ui/ui-button color=constants.Color.Gray light=true label="Sequence" onClick=(action "onInsertSequence")}} {{ui/ui-button color=constants.Color.Gray light=true label="Sequence" onClick=(action "onInsertSequence")}}
@ -22,12 +25,10 @@
{{ui/ui-button color=constants.Color.Gray light=true label="State" onClick=(action "onInsertState")}} {{ui/ui-button color=constants.Color.Gray light=true label="State" onClick=(action "onInsertState")}}
</p> </p>
</div> </div>
{{focus-textarea value=diagramText rows=30 id=editorId class="diagram-editor form-control mousetrap"}} {{/if}}
</div> </div>
</div> </div>
<Ui::UiSpacer @size="200" />
{{ui/ui-button color=constants.Color.Yellow light=true label=previewButtonCaption onClick=(action "onPreview")}} {{ui/ui-button color=constants.Color.Yellow light=true label=previewButtonCaption onClick=(action "onPreview")}}
<Ui::UiSpacer @size="200" /> <Ui::UiSpacer @size="200" />