On a slightly different note - have you ever wanted to click/tap to rearrange elements on -any- website?<p>Just yesterday I wrote a little bit of JavaScript that will let you reposition any element by dragging it: <a href="http://codepen.io/tomhodgins/pen/LGJKdE" rel="nofollow">http://codepen.io/tomhodgins/pen/LGJKdE</a><p>And of course, I also minified it so it can be used from the address bar or as a bookmarklet. The minified version is at <a href="http://staticresource.com/dragon.js" rel="nofollow">http://staticresource.com/dragon.js</a><p>Ive been having fun loading up sites I know, invoking the JS and then trying to rearrage the elements into better designs! For example, how would HN look if the reply buttons were aligned to the right edge of the textarea they are under, that would be an improvement :) We can try it out!
I know it's not 'cool' but the fact that this supports IE7+ makes it infinitely more useful to me personally.<p>Looks very very nice after a short play with the demo!
From the documentation: "You shouldn't include it in the <head> of your web applications. It's bad practice to place scripts in the <head>, and as such dragula makes no effort to support this use case."<p>Serious question: With nearly 20 years in JS development, the concept of placing scripts not in the head section as being desirable is new to me. (Just saying, it used to be the other way round. Common resources, like scripts were, aside from the title, the main reason, the head tag was introduced at all.) -- Is there a source to this notion of script embedding, or can anyone clarify? (What would be the winning propositions of not using parallel loading slots?)
Very nice. Just lightweight js and it seems to work great.<p>I was going to download it and found:<p><i>If you're not using either package manager, you can use dragula by downloading the files in the dist folder. We strongly suggest using npm, though.</i><p>Why would they <i>strongly suggest</i> installing npm? (obviously I don't use node)
Is it as powerful as XView drag-n-drop under X-Windows?<p><a href="http://www.art.net/~hopkins/Don/unix-haters/x-windows/disaster.html" rel="nofollow">http://www.art.net/~hopkins/Don/unix-haters/x-windows/disast...</a><p>The "drag-and-drop" metaphor tires to cover up the Unix file system, but so little of Unix is designed for the desktop metaphor that it's just one kludge on top of another with little holes and sharp edges popping up everywhere. Maybe the "sag-and-drop" metaphor is more appropriate for such ineffective and unreliable performance.<p>A shining example is Sun's Open Windows File Manager, which goes out of its way to display ore dump files as cute little red bomb icons. When you double-click on the bomb, it runs a text editor on the core dump. Harmless, but not very useful. But if you intuitively drag and drop the bomb on the DBX Debugger Tool, it does exactly what you'd expect if you were a terrorist: it ties the entire system up, as the core dump (including a huge unmapped gap of zeros) is pumped through the server and into the debugger text window, which inflates to the maximum capacity of swap space, then violently explodes, dumping an even bigger core file in place of your original one, filling up the entire file system, overwhelming the file server, and taking out the File Manager with shrapnel. (This bug has since been fixed.)<p>But that's not all: the File Manager puts even more power at your fingertips if you run it as root! When you drag and drop a directory onto itself, it beeps and prints "rename: invalid argument" at the bottom of the window, then instantly deletes the entire directory trwe without bothering to update the graphical directory browser.
God I love that logo: <a href="https://github.com/bevacqua/dragula/raw/master/resources/logo.png" rel="nofollow">https://github.com/bevacqua/dragula/raw/master/resources/log...</a>
Very nice. I once made a shipping planner in X that worked with drag and drop: It was basically a packing game with orders and trucks. You drag the day's orders around to arrange them on the trucks as you like (also you can drag the trucks around, and each truck was a list of orders with a scroll bar). Each truck shows its current capacity and turns red if the capacity is exceeded. Each order shows its delivery address and size (plus you can click on it to view the whole thing). When you are done, you click a button to print the pull tickets, bills of lading and delivery tickets all in the right order. The shipping guys loved it.<p>(Yes, you could try to use an optimization algorithm to do this- at the time I had no access to the map information needed for it. Actually it would have been difficult to beat the shipper's knowledge anyway.)<p>Were I to make this app again, I would want drag and drop in a web application. I'm not sure if Dragula allows dragging between frames (and dragging frames themselves).
I'm enjoying playing with this. The only bit so far that I don't like is that to trigger a switch, the mouse needs to cross the halfway point of the element you want to swap positions with: in my application, it would be much more intuitive for an element being dragged to "claim" a drop-target as soon as the mouse moves over the target. I haven't yet found a way to accomplish this with Dragula.
I tried this project recently. I don't have good reviews. Unbinding the drag / drop and re-binding was such a pain I gave up and went to SortableJS, which is very simple to use.
What's the point of sending this again?<p><a href="https://news.ycombinator.com/item?id=9914045" rel="nofollow">https://news.ycombinator.com/item?id=9914045</a><p>I thought this was considered spammy behaviour: <a href="https://hn.algolia.com/?query=dragula&sort=byPopularity&prefix&page=0&dateRange=all&type=story" rel="nofollow">https://hn.algolia.com/?query=dragula&sort=byPopularity&pref...</a><p>I'm not saying that the lib isn't great.