dragster
dragster copied to clipboard
Not working with ie 11
line 264: e.dataTransfer.setData('text/plain', '')
gives an error.
Thanks for letting me know :) from a quick look it might be fixed by changing text/plain to text http://msdn.microsoft.com/en-us/library/ie/ms536744(v=vs.85).aspx
I'll have a look tomorrow when I have a Windows VM handy.
That is a problem in your demo page, however dragster.js is not working in IE because of the luck of: CustomEvent
would it be possible to replace CustomEvent with:
var evt = document.createEvent("CustomEvent"); evt.initCustomEvent('dragster:leave', true, true, { 'cmd': "blerg!" });
as suggested here: http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563
Any updates on this issue
Sorry everyone, I haven't looked at this repo for ages. #9 fixes this apparently - I don't have IE available for the next few days, can anyone confirm @christophermina's rewrite fixes this issue for you?
I can confirm the pull request is working! I tried within Windows 10 with Internet Explorer 9, 10, 11 and Edge. Looks fine even in IE9!
Interestingly, added CSS-classes don't change the DOM in IE and Edge while "dragster:enter" event. Even jQuery $('#object').css('display', 'block'); doesn't change anything.
Also interestingly the new styles are getting visible on next change, for example if you have :hover styles but i was not able to trigger rerendering while drag.
To reproduce:
- Try changing some DOM while "dragster:enter", e.g. adding a class
- Drag something in
- The classes are added, but the DOM doesn't change visibly
Now if the targeted DOM-element has some :hover CSS-style and you didn't remove the added class on dragster:leave you can hover the element. NOW the styles are shown.
I found a solution for this css-rerendering bug on IE. Im using jQuery, but this may work also for plain JavaScript. My code looks like this:
dropzone.addEventListener("dragster:enter", function(e) {
$index.addClass("dragEnter");
$index.hide().show(0); // IE-fix
}
dropzone.addEventListener("dragster:leave", function(e) {
$index.removeClass("dragEnter");
$index.hide().show(0); // IE-fix
}