{"action":"created","issue":{"url":"https://api.github.com/repos/vakata/jstree/issues/1205","labels_url":"https://api.github.com/repos/vakata/jstree/issues/1205/labels{/name}","comments_url":"https://api.github.com/repos/vakata/jstree/issues/1205/comments","events_url":"https://api.github.com/repos/vakata/jstree/issues/1205/events","html_url":"https://github.com/vakata/jstree/pull/1205","id":103411259,"number":1205,"title":"Fixed minor bug that results in after_close.jstree triggering before …","user":{"login":"Contagious06","id":848426,"avatar_url":"https://avatars.githubusercontent.com/u/848426?v=3","gravatar_id":"","url":"https://api.github.com/users/Contagious06","html_url":"https://github.com/Contagious06","followers_url":"https://api.github.com/users/Contagious06/followers","following_url":"https://api.github.com/users/Contagious06/following{/other_user}","gists_url":"https://api.github.com/users/Contagious06/gists{/gist_id}","starred_url":"https://api.github.com/users/Contagious06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Contagious06/subscriptions","organizations_url":"https://api.github.com/users/Contagious06/orgs","repos_url":"https://api.github.com/users/Contagious06/repos","events_url":"https://api.github.com/users/Contagious06/events{/privacy}","received_events_url":"https://api.github.com/users/Contagious06/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-27T02:28:49Z","updated_at":"2015-08-27T08:31:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vakata/jstree/pulls/1205","html_url":"https://github.com/vakata/jstree/pull/1205","diff_url":"https://github.com/vakata/jstree/pull/1205.diff","patch_url":"https://github.com/vakata/jstree/pull/1205.patch"},"body":"Very minor, however my unit tests fail :/\r\nWorkaround: animation: false\r\n\r\nIf the tree is not in the DOM, the `after_close.jstree` event gets trigger before `close_node.jstree`.\r\n\r\nThis is due to the jquery slide up animation executing immediately:\r\n```javascript\r\nvar $div = $(\"<div/>\");\r\n\r\n$div.slideUp(100, function() { console.log(\"slideUp\") });\r\nconsole.log(\"Something\")\r\n```\r\n\r\nPrints:\r\n```\r\nslideUp\r\nSomething\r\n```\r\n\r\nHowever, adding the element to the DOM fixes this:\r\n```javascript\r\nvar $div = $(\"<div/>\");\r\n$(\"body\").append($div);\r\n\r\n$div.slideUp(100, function() { console.log(\"slideUp\") });\r\nconsole.log(\"Something\")\r\n```\r\n\r\nPrints:\r\n```\r\nSomething\r\nslideUp\r\n```"},"comment":{"url":"https://api.github.com/repos/vakata/jstree/issues/comments/135339583","html_url":"https://github.com/vakata/jstree/pull/1205#issuecomment-135339583","issue_url":"https://api.github.com/repos/vakata/jstree/issues/1205","id":135339583,"user":{"login":"Contagious06","id":848426,"avatar_url":"https://avatars.githubusercontent.com/u/848426?v=3","gravatar_id":"","url":"https://api.github.com/users/Contagious06","html_url":"https://github.com/Contagious06","followers_url":"https://api.github.com/users/Contagious06/followers","following_url":"https://api.github.com/users/Contagious06/following{/other_user}","gists_url":"https://api.github.com/users/Contagious06/gists{/gist_id}","starred_url":"https://api.github.com/users/Contagious06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Contagious06/subscriptions","organizations_url":"https://api.github.com/users/Contagious06/orgs","repos_url":"https://api.github.com/users/Contagious06/repos","events_url":"https://api.github.com/users/Contagious06/events{/privacy}","received_events_url":"https://api.github.com/users/Contagious06/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T08:31:28Z","updated_at":"2015-08-27T08:31:28Z","body":"Thanks for that :)\r\n\r\nHere you go:\r\nhttp://jsfiddle.net/tmdrwddq/1/\r\n\r\nFrom:\r\n```javascript\r\n$('#jstree')\r\n```\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\n\r\nTo:\r\n```javascript\r\n$('<div></div>')\r\n```\r\nAFTER\r\nBEFORE\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\n\r\n\r\nReference to the fixed version: http://jsfiddle.net/xvq3zefn/1/\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\nBEFORE\r\nAFTER\r\n\r\nRegards,\r\nMatt"}}