{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/234","labels_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/234/comments","events_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/234/events","html_url":"https://github.com/bem/bem-forum-content-ru/issues/234","id":57906813,"number":234,"title":"Генерация БЭМ события блока во время его инициализации","user":{"login":"pavel06081991","id":7793321,"avatar_url":"https://avatars.githubusercontent.com/u/7793321?v=3","gravatar_id":"","url":"https://api.github.com/users/pavel06081991","html_url":"https://github.com/pavel06081991","followers_url":"https://api.github.com/users/pavel06081991/followers","following_url":"https://api.github.com/users/pavel06081991/following{/other_user}","gists_url":"https://api.github.com/users/pavel06081991/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel06081991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel06081991/subscriptions","organizations_url":"https://api.github.com/users/pavel06081991/orgs","repos_url":"https://api.github.com/users/pavel06081991/repos","events_url":"https://api.github.com/users/pavel06081991/events{/privacy}","received_events_url":"https://api.github.com/users/pavel06081991/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/api","name":"api","color":"c7def8"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/asktheteam","name":"asktheteam","color":"fef2c0"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/i-bem","name":"i-bem","color":"bfe5bf"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/js","name":"js","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-17T10:25:42Z","updated_at":"2015-02-17T11:01:35Z","closed_at":null,"body":"На одной ноде находятся два блока:\r\n```js\r\n      <section class=\"siteSettings theme i-bem\" data-bem='{\"siteSettings\": {}, \"theme\": {}}'>\r\n```\r\nВ функции-инициализации блока theme происходит подписка на БЭМ событие changeTheme блока siteSettings. Внутри же функции-инициализации блока siteSettings происходит генерация события changeTheme. Но обработчик внутри блока theme не срабатывает, так как ещё не произошла инициализация блока theme, а лишь произошла инициализация блока siteSettings... Как побороть, может есть решения предлагаемые самим i-bem? Спасибо."},"comment":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/comments/74650905","html_url":"https://github.com/bem/bem-forum-content-ru/issues/234#issuecomment-74650905","issue_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/234","id":74650905,"user":{"login":"pavel06081991","id":7793321,"avatar_url":"https://avatars.githubusercontent.com/u/7793321?v=3","gravatar_id":"","url":"https://api.github.com/users/pavel06081991","html_url":"https://github.com/pavel06081991","followers_url":"https://api.github.com/users/pavel06081991/followers","following_url":"https://api.github.com/users/pavel06081991/following{/other_user}","gists_url":"https://api.github.com/users/pavel06081991/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel06081991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel06081991/subscriptions","organizations_url":"https://api.github.com/users/pavel06081991/orgs","repos_url":"https://api.github.com/users/pavel06081991/repos","events_url":"https://api.github.com/users/pavel06081991/events{/privacy}","received_events_url":"https://api.github.com/users/pavel06081991/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T11:01:34Z","updated_at":"2015-02-17T11:01:34Z","body":"То есть инициализация копии блока siteSettings происходит раньше, чем копии блока theme. То есть на момент вызова this.emit('changeTheme'); в блоке siteSettings, подписки насобытие this.params.siteSettings.on('changeTheme' в блоке theme ещё не произошло."}}