{"action":"closed","issue":{"url":"https://api.github.com/repos/bevacqua/dragula/issues/213","labels_url":"https://api.github.com/repos/bevacqua/dragula/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/bevacqua/dragula/issues/213/comments","events_url":"https://api.github.com/repos/bevacqua/dragula/issues/213/events","html_url":"https://github.com/bevacqua/dragula/issues/213","id":108422505,"number":213,"title":"Uncaught TypeError: Cannot read property 'msPointerEnabled'","user":{"login":"sherbrow","id":1212399,"avatar_url":"https://avatars.githubusercontent.com/u/1212399?v=3","gravatar_id":"","url":"https://api.github.com/users/sherbrow","html_url":"https://github.com/sherbrow","followers_url":"https://api.github.com/users/sherbrow/followers","following_url":"https://api.github.com/users/sherbrow/following{/other_user}","gists_url":"https://api.github.com/users/sherbrow/gists{/gist_id}","starred_url":"https://api.github.com/users/sherbrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherbrow/subscriptions","organizations_url":"https://api.github.com/users/sherbrow/orgs","repos_url":"https://api.github.com/users/sherbrow/repos","events_url":"https://api.github.com/users/sherbrow/events{/privacy}","received_events_url":"https://api.github.com/users/sherbrow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-25T23:18:04Z","updated_at":"2015-10-05T17:30:15Z","closed_at":"2015-10-05T17:30:15Z","body":"Seen in other projects with \"browserify packaging\" :\r\nhttps://github.com/hammerjs/hammer.js/issues/424\r\nand their fix https://github.com/lucasgunn/hammer.js/commit/81bab8ee86cf1c8dd386796417fdbf348104b746\r\n\r\nBrowserify packaging (if it is the process that causes it) seems to pass `this` when calling as the `global` namespace [dragula.js#L825](https://github.com/bevacqua/dragula/blob/49f51d369ab6ee1b5de5d49d8c3e755e119aa0e3/dist/dragula.js#L825)\r\nIf the `<script>` is put in the body, `this` is the `document`, not the `window`, causing `global.navigator.msPointerEnabled` to be invalid (`navigator` is only a `window` property) [dragula.js#L506](https://github.com/bevacqua/dragula/blob/49f51d369ab6ee1b5de5d49d8c3e755e119aa0e3/dist/dragula.js#L506)\r\n\r\nI propose a fix by using directly `window` to access `navigator`, since I don't see why that property should be namespaced/mocked up for tests or anything.\r\n\r\nNB: your index.html is working fine probably thanks to the omitted html and body tags"}}