Permalink
Browse files

fix(label): translations and text uses label value first and if not d…

…efined uses key value
  • Loading branch information...
bas080
bas080 committed Jun 8, 2016
1 parent 460a9e5 commit 3f6ea54ef8e68f3d27a5d65630f6729241993dc1
Showing with 12 additions and 3 deletions.
  1. +2 −3 src/frameworks/bootstrap/form-group.html
  2. +10 −0 src/frameworks/form-group.js
@@ -4,9 +4,8 @@
attributes.bind="attribute.attributes"
class="form-group">
<label
class="controle-label"
t.bind="attribute.key || attribute.label"
if.bind="showsLabel">${attribute.key || attribute.label}</label>
t.bind="labelText"
if.bind="showsLabel">${labelText}</label>
<content></content>
<span class="help-block">${message}</span>
</div>
@@ -18,4 +18,14 @@ export class FormGroup {
return (this.message !== false);
}

/**
* first check if a label was defined and if not fallback to the key property
*
* @returns {string}
*/
@computedFrom('attribute')
get labelText() {
return this.attribute.label || this.attribute.key;
}

}

0 comments on commit 3f6ea54

Please sign in to comment.