Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your classnames are unique, the solution is rather simple. You can change the <code>$</code> function to get by class name instead of by id:</p> <pre><code>var webkit_tools = { //$ function - simply a more robust getElementById $:function(e) { if(typeof(e) == 'string') { return document.getElementsByClassName(e)[0]; // return document.getElementById(e); } return e; }, ... snipped ... </code></pre> <p>I've verified the above solution works (dragging and dropping) on my iPhone, but again, if the classnames are not unique, some added work will be in order based on the script's current implementation.</p> <p>~~~EDIT~~~</p> <p>In re-reading your request, you state that there will in fact NOT be unique classnames, hence the need for some sort of "bulk" drag/drop functionality. I've modified/extended the framework to support this. You can find the source for the modified version here:</p> <p><a href="https://gist.github.com/2474416" rel="nofollow">https://gist.github.com/2474416</a></p> <p>I had to change the API slightly. The dropabble API is unchanged, so passing a classname will simply add/remove the whole list of elements matching the classname passed. The clickable/draggable API was not so easy. To avoid a harsh rewrite, I updated the initialize methods for draggable/clickable to take an element ref rather than id or classname.</p> <p>Correspondingly, I added a <code>bulk_draggable(clazzname, options)</code> and <code>bulk_clickable(clazzname, options)</code> function that basically iterates over the matched elements and calls the corresponding initializers. These functions return an array of draggables/clickables (one for each matched element).</p> <p>Let me know if the "new" API is unclear. I did this rather quickly and lightly tested the happy paths, but can't invest and substantial amount of time rewriting the entire script.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload