{"action":"created","comment":{"url":"https://api.github.com/repos/bem/bem-core/pulls/comments/23082845","id":23082845,"diff_hunk":"@@ -0,0 +1,122 @@\n+# `dom`\n+\n+Блок реализует набор методов – утилит для работы с DOM-деревом документа. \n+\n+## Публичные методы блока\n+\n+### `contains`\n+\n+Метод позволяет проверить содержит ли некоторый DOM-элемент `ctx` вложенный элемент `domElem`. \n+\n+ * `ctx` `{jQuery}` – DOM-элемент внутри которого производится поиск.\n+ * `domElem` `{jQuery}` – искомый DOM-элемент.\n+\n+Метод возвращает `true`, если искомый элемент найден.\n+\n+Например, в блоке `popup` с модификатором `autoclosable` из библиотеки `bem-components` метод используется функцией `_onDocPointerClick`. С его помощь проверяется, не был ли щелчок мыши, вызвавшее событие, произведен по одному из дочерних элементов цели попапа:\n+\n+```js\n+    _onDocPointerClick : function(e) {\n+        if(this.hasMod('target', 'anchor') && dom.contains(this._anchor, $(e.target))) return;\n+\n+    /* ... */\n+\n+    }\n+```\n+\n+### `getFocused`\n+\n+Метод служит для получения ссылки на DOM-элемент, находящийся в фокусе. Не принимает аргументов.\n+Возвращаемое значение `{jQuery}` – объект в фокусе.\n+\n+В следующем примере по щелчку мыши в консоль выводится DOM-элемент, находящийся в фокусе.\n+\n+```js\n+modules.define('getfocus',","path":"common.blocks/dom/dom.ru.md","position":35,"original_position":35,"commit_id":"44e992e1babd1725a8eafb4c5f3e1f3b6415abca","original_commit_id":"44e992e1babd1725a8eafb4c5f3e1f3b6415abca","user":{"login":"tadatuta","id":475746,"avatar_url":"https://avatars.githubusercontent.com/u/475746?v=3","gravatar_id":"","url":"https://api.github.com/users/tadatuta","html_url":"https://github.com/tadatuta","followers_url":"https://api.github.com/users/tadatuta/followers","following_url":"https://api.github.com/users/tadatuta/following{/other_user}","gists_url":"https://api.github.com/users/tadatuta/gists{/gist_id}","starred_url":"https://api.github.com/users/tadatuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadatuta/subscriptions","organizations_url":"https://api.github.com/users/tadatuta/orgs","repos_url":"https://api.github.com/users/tadatuta/repos","events_url":"https://api.github.com/users/tadatuta/events{/privacy}","received_events_url":"https://api.github.com/users/tadatuta/received_events","type":"User","site_admin":false},"body":"```js\r\nmodules.require(['dom'], function(Dom) {\r\n    Dom.getFocused(); // ссылка на элемент в фокусе\r\n});\r\n```","created_at":"2015-01-16T14:33:14Z","updated_at":"2015-01-16T14:33:14Z","html_url":"https://github.com/bem/bem-core/pull/796#discussion_r23082845","pull_request_url":"https://api.github.com/repos/bem/bem-core/pulls/796","_links":{"self":{"href":"https://api.github.com/repos/bem/bem-core/pulls/comments/23082845"},"html":{"href":"https://github.com/bem/bem-core/pull/796#discussion_r23082845"},"pull_request":{"href":"https://api.github.com/repos/bem/bem-core/pulls/796"}}},"pull_request":{"url":"https://api.github.com/repos/bem/bem-core/pulls/796","id":27508321,"html_url":"https://github.com/bem/bem-core/pull/796","diff_url":"https://github.com/bem/bem-core/pull/796.diff","patch_url":"https://github.com/bem/bem-core/pull/796.patch","issue_url":"https://api.github.com/repos/bem/bem-core/issues/796","number":796,"state":"open","locked":false,"title":"dom block Russian description Close #780","user":{"login":"Murdalay","id":3054826,"avatar_url":"https://avatars.githubusercontent.com/u/3054826?v=3","gravatar_id":"","url":"https://api.github.com/users/Murdalay","html_url":"https://github.com/Murdalay","followers_url":"https://api.github.com/users/Murdalay/followers","following_url":"https://api.github.com/users/Murdalay/following{/other_user}","gists_url":"https://api.github.com/users/Murdalay/gists{/gist_id}","starred_url":"https://api.github.com/users/Murdalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murdalay/subscriptions","organizations_url":"https://api.github.com/users/Murdalay/orgs","repos_url":"https://api.github.com/users/Murdalay/repos","events_url":"https://api.github.com/users/Murdalay/events{/privacy}","received_events_url":"https://api.github.com/users/Murdalay/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-16T14:24:59Z","updated_at":"2015-01-16T14:33:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d340a027ab8f980d9e7296b2c95422404a941547","assignee":{"login":"tadatuta","id":475746,"avatar_url":"https://avatars.githubusercontent.com/u/475746?v=3","gravatar_id":"","url":"https://api.github.com/users/tadatuta","html_url":"https://github.com/tadatuta","followers_url":"https://api.github.com/users/tadatuta/followers","following_url":"https://api.github.com/users/tadatuta/following{/other_user}","gists_url":"https://api.github.com/users/tadatuta/gists{/gist_id}","starred_url":"https://api.github.com/users/tadatuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadatuta/subscriptions","organizations_url":"https://api.github.com/users/tadatuta/orgs","repos_url":"https://api.github.com/users/tadatuta/repos","events_url":"https://api.github.com/users/tadatuta/events{/privacy}","received_events_url":"https://api.github.com/users/tadatuta/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/bem/bem-core/pulls/796/commits","review_comments_url":"https://api.github.com/repos/bem/bem-core/pulls/796/comments","review_comment_url":"https://api.github.com/repos/bem/bem-core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bem/bem-core/issues/796/comments","statuses_url":"https://api.github.com/repos/bem/bem-core/statuses/44e992e1babd1725a8eafb4c5f3e1f3b6415abca","head":{"label":"bem:issues/#780@v2","ref":"issues/#780@v2","sha":"44e992e1babd1725a8eafb4c5f3e1f3b6415abca","user":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"repo":{"id":8100172,"name":"bem-core","full_name":"bem/bem-core","owner":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem/bem-core","description":"BEM Core Library","fork":false,"url":"https://api.github.com/repos/bem/bem-core","forks_url":"https://api.github.com/repos/bem/bem-core/forks","keys_url":"https://api.github.com/repos/bem/bem-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem/bem-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem/bem-core/teams","hooks_url":"https://api.github.com/repos/bem/bem-core/hooks","issue_events_url":"https://api.github.com/repos/bem/bem-core/issues/events{/number}","events_url":"https://api.github.com/repos/bem/bem-core/events","assignees_url":"https://api.github.com/repos/bem/bem-core/assignees{/user}","branches_url":"https://api.github.com/repos/bem/bem-core/branches{/branch}","tags_url":"https://api.github.com/repos/bem/bem-core/tags","blobs_url":"https://api.github.com/repos/bem/bem-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem/bem-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem/bem-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem/bem-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem/bem-core/statuses/{sha}","languages_url":"https://api.github.com/repos/bem/bem-core/languages","stargazers_url":"https://api.github.com/repos/bem/bem-core/stargazers","contributors_url":"https://api.github.com/repos/bem/bem-core/contributors","subscribers_url":"https://api.github.com/repos/bem/bem-core/subscribers","subscription_url":"https://api.github.com/repos/bem/bem-core/subscription","commits_url":"https://api.github.com/repos/bem/bem-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem/bem-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem/bem-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem/bem-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/bem/bem-core/contents/{+path}","compare_url":"https://api.github.com/repos/bem/bem-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem/bem-core/merges","archive_url":"https://api.github.com/repos/bem/bem-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem/bem-core/downloads","issues_url":"https://api.github.com/repos/bem/bem-core/issues{/number}","pulls_url":"https://api.github.com/repos/bem/bem-core/pulls{/number}","milestones_url":"https://api.github.com/repos/bem/bem-core/milestones{/number}","notifications_url":"https://api.github.com/repos/bem/bem-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem/bem-core/labels{/name}","releases_url":"https://api.github.com/repos/bem/bem-core/releases{/id}","created_at":"2013-02-08T19:53:17Z","updated_at":"2015-01-14T10:30:48Z","pushed_at":"2015-01-16T14:24:08Z","git_url":"git://github.com/bem/bem-core.git","ssh_url":"git@github.com:bem/bem-core.git","clone_url":"https://github.com/bem/bem-core.git","svn_url":"https://github.com/bem/bem-core","homepage":"https://bem.info/libs/bem-core","size":6967,"stargazers_count":97,"watchers_count":97,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":101,"forks":56,"open_issues":101,"watchers":97,"default_branch":"v2"}},"base":{"label":"bem:v2","ref":"v2","sha":"4486b82da799e8273536fceee497753d387ae57d","user":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"repo":{"id":8100172,"name":"bem-core","full_name":"bem/bem-core","owner":{"login":"bem","id":223412,"avatar_url":"https://avatars.githubusercontent.com/u/223412?v=3","gravatar_id":"","url":"https://api.github.com/users/bem","html_url":"https://github.com/bem","followers_url":"https://api.github.com/users/bem/followers","following_url":"https://api.github.com/users/bem/following{/other_user}","gists_url":"https://api.github.com/users/bem/gists{/gist_id}","starred_url":"https://api.github.com/users/bem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem/subscriptions","organizations_url":"https://api.github.com/users/bem/orgs","repos_url":"https://api.github.com/users/bem/repos","events_url":"https://api.github.com/users/bem/events{/privacy}","received_events_url":"https://api.github.com/users/bem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem/bem-core","description":"BEM Core Library","fork":false,"url":"https://api.github.com/repos/bem/bem-core","forks_url":"https://api.github.com/repos/bem/bem-core/forks","keys_url":"https://api.github.com/repos/bem/bem-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem/bem-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem/bem-core/teams","hooks_url":"https://api.github.com/repos/bem/bem-core/hooks","issue_events_url":"https://api.github.com/repos/bem/bem-core/issues/events{/number}","events_url":"https://api.github.com/repos/bem/bem-core/events","assignees_url":"https://api.github.com/repos/bem/bem-core/assignees{/user}","branches_url":"https://api.github.com/repos/bem/bem-core/branches{/branch}","tags_url":"https://api.github.com/repos/bem/bem-core/tags","blobs_url":"https://api.github.com/repos/bem/bem-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem/bem-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem/bem-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem/bem-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem/bem-core/statuses/{sha}","languages_url":"https://api.github.com/repos/bem/bem-core/languages","stargazers_url":"https://api.github.com/repos/bem/bem-core/stargazers","contributors_url":"https://api.github.com/repos/bem/bem-core/contributors","subscribers_url":"https://api.github.com/repos/bem/bem-core/subscribers","subscription_url":"https://api.github.com/repos/bem/bem-core/subscription","commits_url":"https://api.github.com/repos/bem/bem-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem/bem-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem/bem-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem/bem-core/issues/comments/{number}","contents_url":"https://api.github.com/repos/bem/bem-core/contents/{+path}","compare_url":"https://api.github.com/repos/bem/bem-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem/bem-core/merges","archive_url":"https://api.github.com/repos/bem/bem-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem/bem-core/downloads","issues_url":"https://api.github.com/repos/bem/bem-core/issues{/number}","pulls_url":"https://api.github.com/repos/bem/bem-core/pulls{/number}","milestones_url":"https://api.github.com/repos/bem/bem-core/milestones{/number}","notifications_url":"https://api.github.com/repos/bem/bem-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem/bem-core/labels{/name}","releases_url":"https://api.github.com/repos/bem/bem-core/releases{/id}","created_at":"2013-02-08T19:53:17Z","updated_at":"2015-01-14T10:30:48Z","pushed_at":"2015-01-16T14:24:08Z","git_url":"git://github.com/bem/bem-core.git","ssh_url":"git@github.com:bem/bem-core.git","clone_url":"https://github.com/bem/bem-core.git","svn_url":"https://github.com/bem/bem-core","homepage":"https://bem.info/libs/bem-core","size":6967,"stargazers_count":97,"watchers_count":97,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":101,"forks":56,"open_issues":101,"watchers":97,"default_branch":"v2"}},"_links":{"self":{"href":"https://api.github.com/repos/bem/bem-core/pulls/796"},"html":{"href":"https://github.com/bem/bem-core/pull/796"},"issue":{"href":"https://api.github.com/repos/bem/bem-core/issues/796"},"comments":{"href":"https://api.github.com/repos/bem/bem-core/issues/796/comments"},"review_comments":{"href":"https://api.github.com/repos/bem/bem-core/pulls/796/comments"},"review_comment":{"href":"https://api.github.com/repos/bem/bem-core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bem/bem-core/pulls/796/commits"},"statuses":{"href":"https://api.github.com/repos/bem/bem-core/statuses/44e992e1babd1725a8eafb4c5f3e1f3b6415abca"}}}}