{"action":"created","issue":{"url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/1","labels_url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/1/comments","events_url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/1/events","html_url":"https://github.com/foxythemes/jquery-niftymodals/issues/1","id":109145149,"number":1,"title":"Button Handling Issue","user":{"login":"tgourley","id":495655,"avatar_url":"https://avatars.githubusercontent.com/u/495655?v=3","gravatar_id":"","url":"https://api.github.com/users/tgourley","html_url":"https://github.com/tgourley","followers_url":"https://api.github.com/users/tgourley/followers","following_url":"https://api.github.com/users/tgourley/following{/other_user}","gists_url":"https://api.github.com/users/tgourley/gists{/gist_id}","starred_url":"https://api.github.com/users/tgourley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgourley/subscriptions","organizations_url":"https://api.github.com/users/tgourley/orgs","repos_url":"https://api.github.com/users/tgourley/repos","events_url":"https://api.github.com/users/tgourley/events{/privacy}","received_events_url":"https://api.github.com/users/tgourley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-30T17:53:17Z","updated_at":"2015-10-01T16:43:12Z","closed_at":"2015-10-01T16:42:17Z","body":"I have implemented the current version, and it does not seem to be handling the button events correctly.  When I click on the cancel button or ok button, they both popup the \"Everything is ok!\" and \"You can cancel the modal close event returning false\" messages.  It is as if it is running both callback methods.\r\n\r\nSetup...\r\n```javascript\r\n$(\".remove-student-from-course\").click(function () {\r\n\tvar student_id = $(this).data(\"id\");\r\n\r\n\t$(\"#remove-student-modal\").niftyModal({\r\n\t\tdata: {\r\n\t\t\tid: student_id\r\n\t\t},\r\n\t\tbuttons: [\r\n\t\t\t{\r\n\t\t\t\tclass: 'btn-ok',\r\n\t\t\t\tcallback: function (btn, modal, event) {\r\n\t\t\t\t\talert(\"Everything is ok!\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tclass: 'btn-cancel',\r\n\t\t\t\tcallback: function (btn, modal, event) {\r\n\t\t\t\t\talert(\"You can cancel the modal close event returning false\");\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t],\r\n\t\tafterClose: function (modal, event) {\r\n\t\t\tvar row_id = modal.data.id;\r\n\t\t\t//Now you can know the close element with this\r\n\t\t\tvar closeElement = modal.closeEl;\r\n\r\n\t\t\t//Having the close element you can search by its classes\r\n\t\t\tif ($(closeElement).hasClass('btn-ok')) {\r\n\t\t\t\t//Your remove action here\r\n\t\t\t\talert(row_id);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n});\r\n```\r\n\r\nHere is the button...\r\n```html\r\n<a href=\"#\" class=\"remove-student-from-course\" data-id=\"11\">\r\n\t<span class=\"text-danger\">Remove from Course</span>\r\n</a>\r\n```\r\n\r\nHere is the modal...\r\n```html\r\n<div class=\"md-modal colored-header danger md-effect-10\" id=\"remove-student-modal\">\r\n    <div class=\"md-content\">\r\n        <div class=\"modal-header\">\r\n            <h3>Remove Student from Course</h3>\r\n            <button type=\"button\" class=\"close md-close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\r\n        </div>\r\n        <div class=\"modal-body\">\r\n            <div class=\"text-center\">\r\n                <div class=\"i-circle danger\"><i class=\"fa fa-times\"></i></div>\r\n                <h4>Are you sure you would like to remove this student from the course?</h4>\r\n            </div>\r\n        </div>\r\n        <div class=\"modal-footer\">\r\n            <button type=\"button\" class=\"btn btn-default btn-flat md-close btn-cancel\" data-dismiss=\"modal\">Cancel</button>\r\n            <a href=\"#\" class=\"btn btn-danger btn-flat md-close btn-ok\" data-dismiss=\"modal\">Yes, remove this student.</a>\r\n        </div>\r\n    </div>\r\n</div>\r\n```"},"comment":{"url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/comments/144782955","html_url":"https://github.com/foxythemes/jquery-niftymodals/issues/1#issuecomment-144782955","issue_url":"https://api.github.com/repos/foxythemes/jquery-niftymodals/issues/1","id":144782955,"user":{"login":"miguelmich","id":662930,"avatar_url":"https://avatars.githubusercontent.com/u/662930?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelmich","html_url":"https://github.com/miguelmich","followers_url":"https://api.github.com/users/miguelmich/followers","following_url":"https://api.github.com/users/miguelmich/following{/other_user}","gists_url":"https://api.github.com/users/miguelmich/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelmich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelmich/subscriptions","organizations_url":"https://api.github.com/users/miguelmich/orgs","repos_url":"https://api.github.com/users/miguelmich/repos","events_url":"https://api.github.com/users/miguelmich/events{/privacy}","received_events_url":"https://api.github.com/users/miguelmich/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T16:43:12Z","updated_at":"2015-10-01T16:43:12Z","body":"Ok, thanks for repoting this issue, now it should work fine :)"}}