How do I change the default file?
Hello
I am using Dropify.js and I want to edit some elements, so when I click on edit an element, the dropify class input works fine, it automatically downloads the given file with this piece of code:
$('.dropify').dropify({
defaultFile: app.getPath('userData') + '/images/' + doc.image
});
but when i want to edit another item the file won't change it yet the first one. I hope you can understand me. the elements are in the table. I found this, but I don't know how to do it:
var drDestroy = $('.dropify').dropify();
drDestroy = drDestroy.data('dropify')
$('#toggleDropify').on('click', function(e){
e.preventDefault();
if (drDestroy.isDropified()) {
drDestroy.destroy();
} else {
drDestroy.init();
}
})
if anyone can tell me that init () and destroy () and isDropified () functions are executed by exaclty.
+3
source to share
2 answers