Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions blocks-common/i-bem/__html/i-bem__html.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,13 @@ default: {
var mixItem = mix[i];

if (!mixItem) continue;

var hasItem = mixItem.block || mixItem.elem,
var hasItem = (mixItem.block && (this.block !== v.block || mixItem.block !== this.block))
|| (this.elem && (!mixItem.elemMods && !mixItem.mods))
|| mixItem.elem ,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space before ,

block = mixItem.block || mixItem._block || this.block,
elem = mixItem.elem || mixItem._elem || this.elem,
mods = mixItem.mods || this.mods,
elemMods = mixItem.elemMods || {};

hasItem && buf.push(' ');
BEM_.INTERNAL[hasItem? 'buildClasses' : 'buildModsClasses'](
block,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="b1 b1_m1_v1"></div><div class="b1 b1_m1_v1"></div><div class="b1 b2 b2_m1_v1"></div><div class="b1__e1 b1"></div><div class="b2 b1__e1"></div><div class="b1 b1__e1"></div><div class="b1__e1 b1__e1_m1_v1"></div><div class="b1__e1 b1__e1_m1_v1"></div><div class="b1__e1 b1__e2 b1__e2_m2_v2"></div><div class="b1__e1 b1__e1_m1_v1 b1__e2 b1__e2_m2_v2"></div><div class="b1__e1 b1__e1_m1_v1 b1__e2"></div>
60 changes: 60 additions & 0 deletions blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[
{
"block": "b1",
"mix": {
"block": "b1",
"mods": { "m1": "v1" }
}
},
{
"block": "b1",
"mix": {"mods": {"m1": "v1"}}
},
{
"block": "b1",
"mix": {
"block": "b2",
"mods": { "m1": "v1" }
}
},
{
"block": "b1",
"elem": "e1",
"mix": [{ "block": "b1" }]
},
{
"block": "b2",
"mix": [{ "block": "b1", "elem": "e1" }]
},
{
"block": "b1",
"mix": {"elem": "e1"}
},
{
"block": "b1",
"elem": "e1",
"mix": {"elemMods": {"m1": "v1"}}
},
{
"block": "b1",
"elem": "e1",
"mix": {"mods": {"m1": "v1"}}
},
{
"block": "b1",
"elem": "e1",
"mix": {"elem": "e2", "elemMods": {"m2": "v2"}}
},
{
"block": "b1",
"elem": "e1",
"elemMods": {"m1": "v1"},
"mix": {"elem": "e2", "elemMods": {"m2": "v2"}}
},
{
"block": "b1",
"elem": "e1",
"elemMods": {"m1": "v1"},
"mix": {"elem": "e2"}
}
]
1 change: 1 addition & 0 deletions blocks-common/i-bem/__html/test/i-bem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ suite('i-bem block and others', function() {
unit('simple types regression #254', 'gh-254');
unit('applyNext in content regression #289', 'gh-289');
unit('mods redefinition #550', 'gh-550');
unit('mix elem on same block', 'gh-core-804');
unit('block with escaping this', 'escaping-this');

test('re-entrance', function() {
Expand Down