{"action":"opened","issue":{"url":"https://api.github.com/repos/almende/vis/issues/2842","repository_url":"https://api.github.com/repos/almende/vis","labels_url":"https://api.github.com/repos/almende/vis/issues/2842/labels{/name}","comments_url":"https://api.github.com/repos/almende/vis/issues/2842/comments","events_url":"https://api.github.com/repos/almende/vis/issues/2842/events","html_url":"https://github.com/almende/vis/issues/2842","id":212593014,"number":2842,"title":"Redirect to blank page after drag and drop to create an item in the timeline.js with FireFox","user":{"login":"guillaumevial","id":26262671,"avatar_url":"https://avatars3.githubusercontent.com/u/26262671?v=3","gravatar_id":"","url":"https://api.github.com/users/guillaumevial","html_url":"https://github.com/guillaumevial","followers_url":"https://api.github.com/users/guillaumevial/followers","following_url":"https://api.github.com/users/guillaumevial/following{/other_user}","gists_url":"https://api.github.com/users/guillaumevial/gists{/gist_id}","starred_url":"https://api.github.com/users/guillaumevial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillaumevial/subscriptions","organizations_url":"https://api.github.com/users/guillaumevial/orgs","repos_url":"https://api.github.com/users/guillaumevial/repos","events_url":"https://api.github.com/users/guillaumevial/events{/privacy}","received_events_url":"https://api.github.com/users/guillaumevial/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-07T23:34:18Z","updated_at":"2017-03-07T23:34:18Z","closed_at":null,"body":"Hello,\r\n\r\nThanks for your great work. I am using the timeline lib and it is amazing !\r\n\r\nI have found a bug when using drag and drop in FireFox to create a new item in the timeline with FireFox. Chrome, Safari and IE do not seem to suffer from this issue.\r\nAfter dropping a new item on the timeline, FireFox redirect the user to a blank page.\r\nI could reproduce the issue using your example page : http://visjs.org/examples/timeline/other/drag&drop.html\r\n\r\nAfter having searched a little bit on the net, I found a solution I want to share with you. \r\n\r\nI have modified the code of the timeline/component/Core.js. I have changed the function \"handleDrop(event)\" like that and it fixed my issue : \r\n\r\n  function handleDrop(event) {\r\n    // FIX drop redirect in FIREFOX : START\r\n    if(event.preventDefault) { event.preventDefault(); }\r\n    if(event.stopPropagation) { event.stopPropagation(); }\r\n    // FIX drop redirect in FIREFOX : END\r\n    // return when dropping non-vis items\r\n    try {\r\n      var itemData = JSON.parse(event.dataTransfer.getData(\"text\"))\r\n      if (!itemData.content) return\r\n    } catch (err) {\r\n      return false;\r\n    }\r\n\r\n    itemAddedToTimeline = false;\r\n    event.center = {\r\n      x: event.clientX,\r\n      y: event.clientY\r\n    }\r\n    me.itemSet._onAddItem(event);\r\n\r\n    return false;\r\n  }\r\n\r\nAs I am not an expert, I am not sure that is the best way to solve the issue. I would be interested to get your feedback on it. It could help someone else facing the same issue to find a workaround and perhaps help you to integrate this fix in the next release.\r\n\r\nThanks again for your great work.\r\n\r\nGuillaume"}}
{"actor":{"display_login":"guillaumevial"}}