{"action":"created","issue":{"url":"https://api.github.com/repos/jcbrand/converse.js/issues/590","repository_url":"https://api.github.com/repos/jcbrand/converse.js","labels_url":"https://api.github.com/repos/jcbrand/converse.js/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/jcbrand/converse.js/issues/590/comments","events_url":"https://api.github.com/repos/jcbrand/converse.js/issues/590/events","html_url":"https://github.com/jcbrand/converse.js/pull/590","id":133559362,"number":590,"title":"Don't steal focus when chatbox is opened automatically","user":{"login":"rlanvin","id":1701590,"avatar_url":"https://avatars.githubusercontent.com/u/1701590?v=3","gravatar_id":"","url":"https://api.github.com/users/rlanvin","html_url":"https://github.com/rlanvin","followers_url":"https://api.github.com/users/rlanvin/followers","following_url":"https://api.github.com/users/rlanvin/following{/other_user}","gists_url":"https://api.github.com/users/rlanvin/gists{/gist_id}","starred_url":"https://api.github.com/users/rlanvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlanvin/subscriptions","organizations_url":"https://api.github.com/users/rlanvin/orgs","repos_url":"https://api.github.com/users/rlanvin/repos","events_url":"https://api.github.com/users/rlanvin/events{/privacy}","received_events_url":"https://api.github.com/users/rlanvin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-14T17:35:44Z","updated_at":"2016-02-15T16:25:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jcbrand/converse.js/pulls/590","html_url":"https://github.com/jcbrand/converse.js/pull/590","diff_url":"https://github.com/jcbrand/converse.js/pull/590.diff","patch_url":"https://github.com/jcbrand/converse.js/pull/590.patch"},"body":"This is an attempt (probably a bit ugly) to fix the problem described in #566 - when somebody talks to you, the opening chatbox steals the focus, which is extremely annoying.\r\n\r\nHere is a quick explanation:\r\n\r\nI noticed that the focus is happening in `ChatBoxView.show`, so I disabled it from here. However it's good to focus when the user open the chatbox manually. I noticed that when the chatbox is opened by a click from the user, the execution flows first through `ChatBoxViews.showChat`. Unfortunately from here I didn't find anyway to call `focus`... so instead I made this method trigger the `show` event with a parameter `focus` set to `true`. I'm not sure what the `callback` parameter was used for, so I left it intact. There is probably a cleaner way to pass the parameter to the event."},"comment":{"url":"https://api.github.com/repos/jcbrand/converse.js/issues/comments/184280550","html_url":"https://github.com/jcbrand/converse.js/pull/590#issuecomment-184280550","issue_url":"https://api.github.com/repos/jcbrand/converse.js/issues/590","id":184280550,"user":{"login":"rlanvin","id":1701590,"avatar_url":"https://avatars.githubusercontent.com/u/1701590?v=3","gravatar_id":"","url":"https://api.github.com/users/rlanvin","html_url":"https://github.com/rlanvin","followers_url":"https://api.github.com/users/rlanvin/followers","following_url":"https://api.github.com/users/rlanvin/following{/other_user}","gists_url":"https://api.github.com/users/rlanvin/gists{/gist_id}","starred_url":"https://api.github.com/users/rlanvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlanvin/subscriptions","organizations_url":"https://api.github.com/users/rlanvin/orgs","repos_url":"https://api.github.com/users/rlanvin/repos","events_url":"https://api.github.com/users/rlanvin/events{/privacy}","received_events_url":"https://api.github.com/users/rlanvin/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T16:25:24Z","updated_at":"2016-02-15T16:25:24Z","body":"Done and thank your for the explanation.\r\n\r\nThe new branch looks great! I was actually starting to feel lost in the 6k+ lines of `converse.js` file, so if you're going to split it I think it would make it much easier to get into the code. :) How soon are you planning to merge it into master?"}}