{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-core/issues/821","labels_url":"https://api.github.com/repos/bem/bem-core/issues/821/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-core/issues/821/comments","events_url":"https://api.github.com/repos/bem/bem-core/issues/821/events","html_url":"https://github.com/bem/bem-core/issues/821","id":55157585,"number":821,"title":"Add helper for getManyMod(elements, modName) ","user":{"login":"mangin","id":7918881,"avatar_url":"https://avatars.githubusercontent.com/u/7918881?v=3","gravatar_id":"","url":"https://api.github.com/users/mangin","html_url":"https://github.com/mangin","followers_url":"https://api.github.com/users/mangin/followers","following_url":"https://api.github.com/users/mangin/following{/other_user}","gists_url":"https://api.github.com/users/mangin/gists{/gist_id}","starred_url":"https://api.github.com/users/mangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangin/subscriptions","organizations_url":"https://api.github.com/users/mangin/orgs","repos_url":"https://api.github.com/users/mangin/repos","events_url":"https://api.github.com/users/mangin/events{/privacy}","received_events_url":"https://api.github.com/users/mangin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-22T14:15:50Z","updated_at":"2015-01-27T21:42:23Z","closed_at":"2015-01-26T09:24:59Z","body":"Для получения значения модификатора документация предлагает использовать метод getMod.\r\nНо если в функцию getMod возвращает значение модификатора, только первого элемента.\r\n\r\nДля решения этой проблемы я написал( под вдохновением функции setMod) следующий хелпер:\r\n```javascript\r\nfunction getManyMod(elements, modName) {\r\n    var block = this,\r\n        result = [];\r\n    elements.each(function () {\r\n        var elem = $(this);\r\n        elem.__bemElemName = block.__bemElemName;\r\n        var mod = block.getMod(elem, modName);\r\n        result.push(mod);\r\n    });\r\n\r\n    return result;\r\n}\r\n```\r\n\r\nhttp://jsfiddle.net/sjycs2gL/\r\nМне бы хотелось узнать: на сколько законно так делать?"},"comment":{"url":"https://api.github.com/repos/bem/bem-core/issues/comments/71733786","html_url":"https://github.com/bem/bem-core/issues/821#issuecomment-71733786","issue_url":"https://api.github.com/repos/bem/bem-core/issues/821","id":71733786,"user":{"login":"veged","id":15365,"avatar_url":"https://avatars.githubusercontent.com/u/15365?v=3","gravatar_id":"","url":"https://api.github.com/users/veged","html_url":"https://github.com/veged","followers_url":"https://api.github.com/users/veged/followers","following_url":"https://api.github.com/users/veged/following{/other_user}","gists_url":"https://api.github.com/users/veged/gists{/gist_id}","starred_url":"https://api.github.com/users/veged/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veged/subscriptions","organizations_url":"https://api.github.com/users/veged/orgs","repos_url":"https://api.github.com/users/veged/repos","events_url":"https://api.github.com/users/veged/events{/privacy}","received_events_url":"https://api.github.com/users/veged/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T21:42:23Z","updated_at":"2015-01-27T21:42:23Z","body":"кажется, что всё должно описываться просто кастомным кодом через какой-нить `map` от набора элементов"}}