Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
veged committed May 6, 2015
1 parent 6e6e34e commit 642411f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 31 deletions.
19 changes: 9 additions & 10 deletions common.blocks/attach/__button/attach__button.bemhtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
block('button')
.match(function() { return this._attach; })(
tag()('span'),
content()(function() {
return [
{ block : 'attach', elem : 'control' },
applyNext()
];
})
);
block('button').match(function() { return this._attach })(
tag()('span'),
content()(function() {
return [
{ block : 'attach', elem : 'control' },
applyNext()
];
})
);
2 changes: 1 addition & 1 deletion common.blocks/attach/attach.bemhtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
block('attach')(
def()(function() { return applyNext({ _attach : this.ctx }); }),
def()(function() { return applyNext({ _attach : this.ctx }) }),

tag()('span'),

Expand Down
12 changes: 6 additions & 6 deletions common.blocks/menu-item/menu-item.bemhtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
block('menu-item')(
js()(function() {
return { val : this.ctx.val };
}),
attrs()({ role : 'menuitem' }),
match(function() { return this._menuMods; }).def()(function() {
def().match(function() { return this._menuMods })(function() {
var mods = this.mods;
mods.theme = mods.theme || this._menuMods.theme;
mods.disabled = mods.disabled || this._menuMods.disabled;
return applyNext();
})
}),
js()(function() {
return { val : this.ctx.val };
}),
attrs()({ role : 'menuitem' })
);
10 changes: 5 additions & 5 deletions common.blocks/menu/_mode/menu_mode_radio.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ block('menu')
.mod('mode', 'radio')
.match(function() {
return this._firstItem && this._checkedItems && !this._checkedItems.length;
})(
def()(function() {
(this._firstItem.mods = this._firstItem.mods || {}).checked = true;
return applyNext();
}));
})
.def()(function() {
(this._firstItem.mods || (this._firstItem.mods = {})).checked = true;
return applyNext();
});
4 changes: 1 addition & 3 deletions common.blocks/select/_mode/select_mode_radio.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
block('select').mod('mode', 'radio')(
def().match(function() {
return this._checkedOptions;
})(function() {
def().match(function() { return this._checkedOptions })(function() {
var checkedOptions = this._checkedOptions,
firstOption = this._firstOption;
if(firstOption && !checkedOptions.length) {
Expand Down
4 changes: 1 addition & 3 deletions common.blocks/select/select.bemhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
block('select')(
def().match(function() {
return !this._select;
})(function() { // TODO: check BEM-XJST for proper applyNext
def().match(function() { return !this._select })(function() { // TODO: check BEM-XJST for proper applyNext
if(!this.mods.mode) throw Error('Can\'t build select without mode modifier');

var ctx = this.ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ block('select').def()(function() {
return applyNext({ _selectCls : this.ctx.cls });
});

block('popup').match(function() {
return this._selectCls;
}).def()(function() {
block('popup').match(function() { return this._selectCls }).def()(function() {
// NOTE: we "mark" popups which are inside select block
// with special classes, so gemini tests could find them
this.ctx.cls = this._selectCls + '-popup';
Expand Down

0 comments on commit 642411f

Please sign in to comment.