You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.
When I set an data attribute 'data-dropify' with something truthy on my element and call element.data() the library do not instantiate the object Dropify correctly as the if results in false.
<input data-dropify="true">My input</input>
var input = $('[data-dropify="true"]');
var data = input.data();
input.dropify({});
$.fn[pluginName] = function(options) {
this.each(function() {
// as the data-attribute data-dropify is something truthy and not
// the Dropify instance it will not create it but will not work too.
if (!$.data(this, pluginName)) {
$.data(this, pluginName, new Dropify(this, options));
}
});
return this;
};
So naming data-dropify data attribute is not a good pratice, but it would be better to the library to not depend on this, making a validation that the result of this call is the Dropify object and not something truthy only.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello
When I set an data attribute 'data-dropify' with something truthy on my element and call
element.data()
the library do not instantiate the object Dropify correctly as theif
results in false.So naming data-dropify data attribute is not a good pratice, but it would be better to the library to not depend on this, making a validation that the result of this call is the
Dropify
object and not something truthy only.The text was updated successfully, but these errors were encountered: