{"action":"created","issue":{"url":"https://api.github.com/repos/kikinteractive/app/issues/74","labels_url":"https://api.github.com/repos/kikinteractive/app/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/kikinteractive/app/issues/74/comments","events_url":"https://api.github.com/repos/kikinteractive/app/issues/74/events","html_url":"https://github.com/kikinteractive/app/issues/74","id":58315701,"number":74,"title":"Double click firing on .app-button","user":{"login":"renandecarlo","id":6974980,"avatar_url":"https://avatars.githubusercontent.com/u/6974980?v=3","gravatar_id":"","url":"https://api.github.com/users/renandecarlo","html_url":"https://github.com/renandecarlo","followers_url":"https://api.github.com/users/renandecarlo/followers","following_url":"https://api.github.com/users/renandecarlo/following{/other_user}","gists_url":"https://api.github.com/users/renandecarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/renandecarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renandecarlo/subscriptions","organizations_url":"https://api.github.com/users/renandecarlo/orgs","repos_url":"https://api.github.com/users/renandecarlo/repos","events_url":"https://api.github.com/users/renandecarlo/events{/privacy}","received_events_url":"https://api.github.com/users/renandecarlo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-20T06:33:31Z","updated_at":"2015-02-20T15:21:44Z","closed_at":null,"body":"I'm having a problem with app-button classes double firing when an event handler is set to them.\r\n\r\nFor example, using this will fire twice:\r\n```javascript\r\n$(page).find('.app-button').on('click', function() {});\r\n```\r\n\r\nBut using it this way, fires only once:\r\n```javascript\r\n$(page).on('click', '.app-button', function() {});\r\n```\r\n\r\n\r\nFor some weird reason, if I call any other function within the handler, it fires only once. So it is only happening on buttons that don't call other functions.\r\nEven more weird, for some reason (jquery, clickable lib, or because of javascript itself) it clicks twice at the same place, instead of twice the same button. So when I have a dialog, and one of its buttons are right above another one (on the page itself), it would click both the dialog one and the one below. \r\n\r\nI could get past it using the second method but my mind was blown as to why this was happening.\r\n\r\nI'm using jQuery by the way."},"comment":{"url":"https://api.github.com/repos/kikinteractive/app/issues/comments/75254843","html_url":"https://github.com/kikinteractive/app/issues/74#issuecomment-75254843","issue_url":"https://api.github.com/repos/kikinteractive/app/issues/74","id":75254843,"user":{"login":"renandecarlo","id":6974980,"avatar_url":"https://avatars.githubusercontent.com/u/6974980?v=3","gravatar_id":"","url":"https://api.github.com/users/renandecarlo","html_url":"https://github.com/renandecarlo","followers_url":"https://api.github.com/users/renandecarlo/followers","following_url":"https://api.github.com/users/renandecarlo/following{/other_user}","gists_url":"https://api.github.com/users/renandecarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/renandecarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renandecarlo/subscriptions","organizations_url":"https://api.github.com/users/renandecarlo/orgs","repos_url":"https://api.github.com/users/renandecarlo/repos","events_url":"https://api.github.com/users/renandecarlo/events{/privacy}","received_events_url":"https://api.github.com/users/renandecarlo/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T15:21:44Z","updated_at":"2015-02-20T15:21:44Z","body":"I'm using templates, and was calling clickable() when inserting into the DOM. The click event however was already set on the Controller. I'll give it a try, that might do it.\r\n\r\nHowever, if you see my second comment, you'll see that despite this handlering problem, it's also firing the click twice. \r\nYou can test it with a normal button that shows up a full page div (like a dialog-like opaque background, for eg). If that div has a click event to fadeout or do something else, it will immediately be called after the button click (considering you show it upon button click).\r\n\r\nWhat I was having was exactly that. I had a custom mini-dialog and a button in the top of the page that called it. I click the button and it immediately clicks the dialog background."}}