nativesortable
nativesortable copied to clipboard
use native classList functionality
I noticed that there are some helper functions for manipulating classes.
I was wondering why, since classList is actually better supported than drag. Although, it looks like IE <= 9 doesn't support classList, but I am not sure how well they support drag either. As far as reasons why, it would probably be better performance and smaller code base to just use classList, on the downside, it would mean supporting IE > 9 only.
IIRC, drag and drop has been supported since at least IE 5.5. But I haven't checked this library against older versions of IE in a while. It would be worth checking in <=8 to see if we are working right now It'd be a shame to break it if it was already working in these releases, but if it's already broken we could probably move on and use the newer stuff.
I don't think performance is a real consideration given how infrequently the class names are modified. If things are working in old IE. Although we could always modify the addClassName/hasClassName/removeClassName function to use the classList API if available.
I just checked it in IE 8 and IE 9.
IE 8 says it has no addEventListener which is the attachEvent problem, and IE 9 wasn't working either, except when dragging an a tag (which is apparently a known issue), but it was also throwing an error on this line.
IE 8 says it has no addEventListener which is the attachEvent problem
Oh right, addEventListener. I'd say we can go ahead and switch to classList in that case.
IE 9 wasn't working either, except when dragging an a tag (which is apparently a known issue), but it was also throwing an error on this line.
What if we try/catch that line(s)? Will it work in IE9 in that case?
It's possible. It seems like there might be more things than just the one line though.