Skip to content

Commit

Permalink
Merge pull request #888 from /issues/887@v2
Browse files Browse the repository at this point in the history
button: collapsed without given specified text (close #887)
  • Loading branch information
dfilatov committed Jul 29, 2014
2 parents 918a89f + a631bd9 commit ec46c68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.blocks/button/button.bemhtml
Expand Up @@ -45,7 +45,7 @@ block('button')(
var ctx = this.ctx,
content = [ctx.icon];
// NOTE: wasn't moved to separate template for optimization
ctx.text && content.push({ elem : 'text', content : ctx.text });
'text' in ctx && content.push({ elem : 'text', content : ctx.text });
return content;
},
match(function() { return typeof this.ctx.content !== 'undefined'; })(function() {
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.bh.js
Expand Up @@ -26,7 +26,7 @@ module.exports = function(bh) {
var content = ctx.content();
if(typeof content === 'undefined') {
content = [json.icon];
json.text && content.push({ elem : 'text', content : json.text });
'text' in json && content.push({ elem : 'text', content : json.text });
ctx.content(content);
}
});
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.js
Expand Up @@ -71,7 +71,7 @@ provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, /** @lends butto
* @returns {button} this
*/
setText : function(text) {
this.elem('text').text(typeof text === 'undefined'? ' ' : text);
this.elem('text').text(text || '');
return this;
},

Expand Down
5 changes: 5 additions & 0 deletions design/common.blocks/select/_theme/select_theme_normal.styl
Expand Up @@ -12,6 +12,11 @@
.button__text
{
display: block;

&:empty:before
{
content: '\00a0';
}
}

&.button_size_s .button__text
Expand Down

0 comments on commit ec46c68

Please sign in to comment.