{"action":"created","issue":{"url":"https://api.github.com/repos/almende/vis/issues/1033","labels_url":"https://api.github.com/repos/almende/vis/issues/1033/labels{/name}","comments_url":"https://api.github.com/repos/almende/vis/issues/1033/comments","events_url":"https://api.github.com/repos/almende/vis/issues/1033/events","html_url":"https://github.com/almende/vis/issues/1033","id":91165835,"number":1033,"title":"onMove not triggering dataSet update properly","user":{"login":"lBowlin","id":8559223,"avatar_url":"https://avatars.githubusercontent.com/u/8559223?v=3","gravatar_id":"","url":"https://api.github.com/users/lBowlin","html_url":"https://github.com/lBowlin","followers_url":"https://api.github.com/users/lBowlin/followers","following_url":"https://api.github.com/users/lBowlin/following{/other_user}","gists_url":"https://api.github.com/users/lBowlin/gists{/gist_id}","starred_url":"https://api.github.com/users/lBowlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lBowlin/subscriptions","organizations_url":"https://api.github.com/users/lBowlin/orgs","repos_url":"https://api.github.com/users/lBowlin/repos","events_url":"https://api.github.com/users/lBowlin/events{/privacy}","received_events_url":"https://api.github.com/users/lBowlin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/almende/vis/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/almende/vis/labels/Timeline","name":"Timeline","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"josdejong","id":568626,"avatar_url":"https://avatars.githubusercontent.com/u/568626?v=3","gravatar_id":"","url":"https://api.github.com/users/josdejong","html_url":"https://github.com/josdejong","followers_url":"https://api.github.com/users/josdejong/followers","following_url":"https://api.github.com/users/josdejong/following{/other_user}","gists_url":"https://api.github.com/users/josdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/josdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josdejong/subscriptions","organizations_url":"https://api.github.com/users/josdejong/orgs","repos_url":"https://api.github.com/users/josdejong/repos","events_url":"https://api.github.com/users/josdejong/events{/privacy}","received_events_url":"https://api.github.com/users/josdejong/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-06-26T06:06:50Z","updated_at":"2015-07-09T13:02:13Z","closed_at":null,"body":"In the Timeline the onMove callback pushes any changed item to \"changes\", but dataset.update(changes) is not run after the callback. It's present in the code several lines later, but is not being hit from the callback.\r\n\r\n```js\r\nme.options.onMove(itemData, function (itemData) {\r\n          if (itemData) {\r\n            // apply changes\r\n            itemData[dataset._fieldId] = id;\r\n            changes.push(itemData);\r\n          }\r\n```\r\n[line reference](https://github.com/almende/vis/blob/dae3c3d893b839987c4444bf7b05a4d0923515eb/lib/timeline/component/ItemSet.js#L1374)\r\n\r\nbut this never calls the corresponding (because it is outside of the anonymous callback):\r\n```js\r\nif (changes.length) {\r\n      dataset.update(changes);\r\n    }\r\n```\r\n[line reference](https://github.com/almende/vis/blob/dae3c3d893b839987c4444bf7b05a4d0923515eb/lib/timeline/component/ItemSet.js#L1392)"},"comment":{"url":"https://api.github.com/repos/almende/vis/issues/comments/119954297","html_url":"https://github.com/almende/vis/issues/1033#issuecomment-119954297","issue_url":"https://api.github.com/repos/almende/vis/issues/1033","id":119954297,"user":{"login":"josdejong","id":568626,"avatar_url":"https://avatars.githubusercontent.com/u/568626?v=3","gravatar_id":"","url":"https://api.github.com/users/josdejong","html_url":"https://github.com/josdejong","followers_url":"https://api.github.com/users/josdejong/followers","following_url":"https://api.github.com/users/josdejong/following{/other_user}","gists_url":"https://api.github.com/users/josdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/josdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josdejong/subscriptions","organizations_url":"https://api.github.com/users/josdejong/orgs","repos_url":"https://api.github.com/users/josdejong/repos","events_url":"https://api.github.com/users/josdejong/events{/privacy}","received_events_url":"https://api.github.com/users/josdejong/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T13:02:13Z","updated_at":"2015-07-09T13:02:13Z","body":"Good point, this will not work when the `onMove` function is asynchronous."}}