From 6c71a1f18d874707bc1468063b7a6f0a0c344a68 Mon Sep 17 00:00:00 2001 From: sauls8t Date: Wed, 23 Jan 2019 15:44:46 +0000 Subject: [PATCH] Provide options for UI buttons to expand to fill parent --- gui/app/components/ui/ui-button.js | 12 ++++++++++-- gui/app/templates/components/ui/ui-button.hbs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gui/app/components/ui/ui-button.js b/gui/app/components/ui/ui-button.js index 469c4280..2ae0089d 100644 --- a/gui/app/components/ui/ui-button.js +++ b/gui/app/components/ui/ui-button.js @@ -17,15 +17,15 @@ export default Component.extend({ classNames: [], classNameBindings: ['calcClass'], attributeBindings: ['calcAttrs:data-dismiss', 'submitAttrs:type'], - label: '', icon: '', color: '', light: false, themed: false, dismiss: false, + truncate: false, + stretch: false, uppercase: true, - iconClass: '', hasIcon: computed('iconClass', function() { return this.iconClass.trim() != ''; @@ -52,6 +52,14 @@ export default Component.extend({ bc += ' text-case-normal'; } + if (this.truncate) { + bc += ' text-truncate'; + } + + if (this.stretch) { + bc += ' max-width-100 text-left'; + } + return bc; }), diff --git a/gui/app/templates/components/ui/ui-button.hbs b/gui/app/templates/components/ui/ui-button.hbs index f99b0d83..935f6e54 100644 --- a/gui/app/templates/components/ui/ui-button.hbs +++ b/gui/app/templates/components/ui/ui-button.hbs @@ -1,5 +1,5 @@ {{#if hasIcon}} {{/if}} -
{{label}}
+
{{label}}
{{yield}} \ No newline at end of file