Skip to content

Commit

Permalink
Merge d8fe373 into 9940c61
Browse files Browse the repository at this point in the history
  • Loading branch information
tadatuta committed Nov 1, 2014
2 parents 9940c61 + d8fe373 commit df15a81
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common.blocks/i-bem/i-bem.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ def()(function() {
// Transform mix to the single-item array if it's not array
this.isArray(mix) || (mix = [mix]);
for(var i = 0; i < mix.length; i++) {
var mixItem = mix[i],
hasItem = mixItem.block || mixItem.elem,
var mixItem = mix[i];

typeof mixItem === 'string' && (mixItem = { block : mixItem });

var hasItem = mixItem.block || mixItem.elem,
mixBlock = mixItem.block || mixItem._block || this.block,
mixElem = mixItem.elem || mixItem._elem || this.elem;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
block('b1')(
mix()(['clearfix', { block: 'layout', elem: 'cell' }, 'b4'])
);

block('b7').mix()('clearfix');
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="b1 clearfix layout__cell b4 b2"></div><div class="b7 clearfix b12 b8 b9"></div>
10 changes: 10 additions & 0 deletions common.blocks/i-bem/i-bem.test.bemhtml/files/i-bem/string-mix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"block": "b1",
"mix": "b2"
},
{
"block": "b7",
"mix": [{ "block": "b12" }, "b8", "b9"]
}
]
1 change: 1 addition & 0 deletions common.blocks/i-bem/i-bem.test.bemhtml/i-bem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ suite('i-bem block and others', function() {
unit('applyNext in content regression #289', 'gh-289');
unit('boolean mods bem-core/169', 'boolean-mods');
unit('mods redefinition bem-core/441', 'redefine-mods');
unit('string mix', 'string-mix');
});

0 comments on commit df15a81

Please sign in to comment.