-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1022 from bem/bem-xjst-2x@v2
Update templates to support bem-xjst 2.x
- Loading branch information
Showing
4 changed files
with
27 additions
and
33 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
common.blocks/i-bem/i-bem.test.bemhtml/files/i-bem/redefine-mods.bemhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
block('b1').def()(function() { | ||
this.mods.foo = 'bar'; | ||
applyNext(); | ||
return applyNext(); | ||
}); | ||
block('b1').content()('foo bar'); | ||
block('b1').mod('foo', 'bar').content()('foo bar'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,24 @@ | ||
block('page').elem('css')( | ||
def() | ||
.match(function() { return this.ctx.hasOwnProperty('ie'); }) | ||
.match(function() { return !this.ctx._ieCommented; })( | ||
function() { | ||
var ie = this.ctx.ie, | ||
hideRule = !ie? | ||
['gt IE 9', '<!-->', '<!--'] : | ||
ie === '!IE'? | ||
[ie, '<!-->', '<!--'] : | ||
[ie, '', '']; | ||
apply( | ||
'', | ||
{ 'ctx._ieCommented' : true }, | ||
{ | ||
ctx : [ | ||
'<!--[if ' + hideRule[0] + ']>' + hideRule[1], | ||
this.ctx, | ||
hideRule[2] + '<![endif]-->' | ||
] | ||
} | ||
); | ||
}, | ||
match(function() { return this.ctx.ie === true; })(function() { | ||
var url = this.ctx.url; | ||
applyCtx([6, 7, 8, 9].map(function(v) { | ||
return { elem : 'css', url : url + '.ie' + v + '.css', ie : 'IE ' + v }; | ||
})); | ||
})) | ||
block('page').elem('css').def().match(function() { | ||
return this.ctx.hasOwnProperty('ie'); | ||
})( | ||
function() { | ||
var ie = this.ctx.ie, | ||
hideRule = !ie? | ||
['gt IE 9', '<!-->', '<!--'] : | ||
ie === '!IE'? | ||
[ie, '<!-->', '<!--'] : | ||
[ie, '', '']; | ||
|
||
return applyCtx([ | ||
'<!--[if ' + hideRule[0] + ']>' + hideRule[1], | ||
this.ctx, | ||
hideRule[2] + '<![endif]-->' | ||
]); | ||
}, | ||
match(function() { return this.ctx.ie === true; })(function() { | ||
var url = this.ctx.url; | ||
return applyCtx([6, 7, 8, 9].map(function(v) { | ||
return { elem : 'css', url : url + '.ie' + v + '.css', ie : 'IE ' + v }; | ||
})); | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters