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
modules.define('userpick', ['i-bem__dom'], function(provide, BEMDOM) { | |
provide(BEMDOM.decl(this.name, | |
{ | |
onSetMod: { | |
'js': { | |
'inited': function() { | |
this.bindTo('click', function(e) { | |
e.preventDefault(); | |
console.log('click'); | |
}); |
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
block('userControlsGrouping').elem('groupingShowHideButton')( | |
tag()('i'), | |
elemMod('direction', 'down')( | |
cls()('fa fa-angle-down') | |
), | |
elemMod('direction', 'up')( | |
cls()('fa fa-angle-up') | |
) |
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
GroupElements: function() { | |
var elem = this.findElem('linksContainer'); | |
this.setMod(elem, 'visibility', 'visible'); | |
elem = this.findElem('groupingShowHideButton'); | |
elem.domElem.toggleClass('fa fa-arrow-down', 'fa fa-arrow-up'); | |
} |
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
{ | |
block: 'linksGroup', | |
mods: { position: 'right' }, | |
mix: { block: 'clearfix' }, | |
content: [ | |
{ | |
block: 'link', | |
url: '', | |
pseudo: true, | |
mods: { action: 'showHideSettings' }, |
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
modules.define('link', ['i-bem__dom'], function(provide, BEMDOM) { | |
provide(BEMDOM.decl(this.name, {})) | |
}) | |
modules.define('link', ['i-bem__dom'], function(provide, ABlock) { | |
provide(ABlock.decl( | |
{ modName: 'showHideSettings', modVal: true }, | |
{ | |
onSetMod: { | |
'js': { |
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
{ | |
block: 'header-menu', | |
mods: {position: 'left'}, | |
items: [ | |
{ | |
url: 'https://maps.yandex.ru', | |
text: 'Москва', | |
icon: 'geo' | |
} | |
] |
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
block('header-menu')( | |
content()(function() { | |
return this.ctx.items.map(function(item) { | |
return { | |
elem: 'menu-item', | |
url: item.url, | |
pseudo: !item.url, | |
mix: [{ block: 'link' }], | |
js: true, | |
attrs: { |
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
<div class="header-menu__menu-item link" data-bem="{"header-menu__menu-item":{}}"> | |
<i class="header-menu__menu-item-icon fa fa-globe"></i> | |
<span class="header-menu__menu-item-text">Москва</span> | |
</div> |
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
block('header-menu')( | |
content()(function() { | |
return this.ctx.items.map(function(item) { | |
return { | |
elem: 'menu-item', | |
attrs: { href: item.url }, | |
content: item.icon ? | |
[ | |
{ | |
elem: 'menu-item-icon', |
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
block('header-menu')( | |
content()(function() { | |
return this.ctx.items.map(function(item) { | |
return { | |
block: 'link', | |
mix: [{block: 'header-menu', elem: 'menu-item'}], | |
url: item.url, | |
content: item.icon ? | |
[ | |
{ |
OlderNewer