Skip to content

Instantly share code, notes, and snippets.

@kovchiy
Last active July 18, 2016 21:57
Show Gist options
  • Save kovchiy/39b0c0bd6559af78df0cbfacb446fcf4 to your computer and use it in GitHub Desktop.
Save kovchiy/39b0c0bd6559af78df0cbfacb446fcf4 to your computer and use it in GitHub Desktop.
function ConvertLinks(linksArray) {
return {
elem: 'group',
content: linksArray.map(function(item) {
return {
block: 'menu-item',
mods: { type: 'link', userSettingsItem: true },
content: {
block: 'link',
url: item.url,
content: item.text
}
};
})
};
}
block('popup').mod('userSettings', true)(
content()(function(){
return [{
elem: 'topSquare',
content: null
},
{
block: 'menu',
mods : { mode : 'radio' },
content: this.ctx.links.map(ConvertLinks)
}]
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment