Hi. Just seeing if you're interesting in adding this before I implement it.
I want to have one instance of Draggable handle all elements that match an element
. Easiest example is I have a chessboard and want to be able to drag all the pieces on the board without having to declare 32 instances of Draggable. E.g. I want to specify that I want all (<div class="piece"></div>
) that are children of a parent element (<div class="board"></div>
) be draggable.
The way I'm thinking of implementing this is to specify a new parentEle
parameter, and make element
accept a string. Then only need an event listener attached to parentEle
instead of for each element
. I'm not dead-set on names/functionality so if you are interested, would love to hear your feedback about how the API should work for this.
I know this library wants to support IE8, and it seems that querySelectorAll
actually works in IE8, but only if its in standards mode[0]. I don't think polyfilling querySelectorAll
would be worth it just to support IE8 quirks/compat modes. So implementing this for IE8 standards-only mode is what I would target. Then I guess if users need to support IE8 in non-standards mode they could just polyfill querySelectorAll
.
Obviously the original methods would stay the same way in terms of supporting IE8, the requirement would only be for this new functionality.
If you don't think this library's core should support multiple elements, or if features need to support all modes of IE8 then I'll just fork the library. But I thought I'd see if there was interest in adding this to the main library (with the IE8 caveats) before rewriting it for myself.
[0] http://web.archive.org/web/20171004213917/https://msdn.microsoft.com/en-us/library/ff462057.aspx#selectorapi (The Selectors API is defined as part of the Selectors API specification and is only available to Web pages displayed in IE8 standards mode
)