bensmithett / dragster Goto Github PK
View Code? Open in Web Editor NEWBetter HTML5 drag events
Home Page: http://bensmithett.github.io/dragster
License: MIT License
Better HTML5 drag events
Home Page: http://bensmithett.github.io/dragster
License: MIT License
Hello.
Today I integrated your library into my project, and I also needed to remove 'dragged-over' css class from the container after the dragged element is dropped inside the container.
But if a dragged element is dropped inside the container the 'dragster:leave' event is not fired.
I made it work like this
var dragster = new Dragster(element[0]);
element.on("drop", function (event) {
dragster.dragleave(event);
})
It looks like a hack.
Maybe you should support dropping events too.
I'm travelling for a while, so have limited computering/internet time for the next little while.
Additionally, I haven't used dragster in production for a couple of years, so I'm definitely no longer the best person to maintain it or respond to issues. I'd call it abandonware and move on, but I still get the occasional issue, PR or email about it, so I assume it's being used in the wild somewhere.
Please let me know if you'd like to take it over ๐
(Ping existing contributors - no pressure! @jankuca @drpepper @christophermina )
Hello!
I am using dragster and have noticed a weird thing. I have dragster binded on the body tag and I need to show a shadow on the full browser window, when I am dragging in some files. And after drop or dragging files out I need to hide it. But, sometimes when I take file and dragging them in the window, the event drag leave is called. It looks like a blink of shadow, after I start dragging in something.
Here is, how it happens on the project demo page - I've just took a file and dragged it in the drop zone, then I've made a screenshot. You see, that not only drag enter event is called, but drag enter and drag leave and then drag enter again.
Chrome and Mozilla browsers.
Do you have any idea how to solve it? Thanks.
Great idea, useless in production without IE support :(
import Dragster from 'dragster'
console.log(Dragster) // Object {}
new Dragster( this.el ) // Uncaught TypeError: _dragster2.default is not a function
Drag and drop onto target, dragster enter fires the first time.
Perform same drag and drop again, dragster enter does not fire until the cursor has left and re-entered.
line 264:
e.dataTransfer.setData('text/plain', '')
gives an error.
Dragster is unlicensed. I'm not a lawyer, but this appears to prohibit others from distributing this code or creating derivative works. I assume this is unintentional.
From the GitHub guidance on licensing:
You're under no obligation to choose a license. However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. If you're creating an open source project, we strongly encourage you to include an open source license. The Open Source Guide provides additional guidance on choosing the correct license for your project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.