| ▲ | gavinray 3 hours ago | ||||||||||||||||
This was circa 2010 or so, and it was a web app. So pre-ES6 JavaScript, before React. Nowadays you would just "npm install drag-and-drop" but back then you often had to hand-roll solutions. If anyone can dig up an ancient library on GitHub for drag-and-drop back in those days, I'd imagine it would be several thousand lines long, not to mention the absolute nightmare that testing something like this with a proper framework and accompanying testing library. | |||||||||||||||||
| ▲ | adastra22 2 hours ago | parent | next [-] | ||||||||||||||||
Ah, I was thinking desktop applications. | |||||||||||||||||
| ▲ | anonymous908213 2 hours ago | parent | prev [-] | ||||||||||||||||
Hit-test where the mouse-down event is fired, hit-test where the mouse-up event is fired. What the hell do you need a library for? > If anyone can dig up an ancient library on GitHub for drag-and-drop back in those days, I'd imagine it would be several thousand lines long, I bet, the JS devs who do write code overcompensate for the ones who can only stitch together libraries. I suppose because the expectation is that the library consumer is incapable of writing their own code extending it, so the library itself must support every possible combination of use cases for a million different users, even though the code any individual consumer actually needs is more like 100 loc. | |||||||||||||||||
| |||||||||||||||||