Closed ChazyTheBest closed 8 years ago
I've just created my own code and it's working ok. I won't PR it since it's just a "workaround" out of the script but I'll leave it here for those interested :)
//jquery.ezdz.js#L276
// create the button inside the button container
$ezdz.parent('div').find('div.arrow_box').html('<a class="removeButton">Quitar imagen</a>');
$ezdz.parent('div').find('div.arrow_box').toggleClass('hide'); // show the container
$('body')
// This is just a fancy styling effect for the button container
.on('mouseover', '.removeButton', function() {
div = $(this).parent().parent();
div.find('.arrow_box').addClass('ezdz-focus');
})
.on('mouseout', '.removeButton', function() {
div = $(this).parent().parent();
div.find('.arrow_box').removeClass('ezdz-focus');
})
// not working in IE, since it's read-only
.on('click', '.removeButton', function() {
div = $(this).parent().parent();
div.find('input[type=file]').val(''); // clear the input
div.children().first().removeClass('ezdz-enter ezdz-accept'); // reset the ezdz container
div.find('div div').html('Arrastrar imagen'); // reset the ezdz container
div.find('div.arrow_box').toggleClass('hide'); // hide the link container
});
Thanks. I will try to find some time to add a reset file method soon.
Are there progresses for the remove link feature? Thanks in advance.
Hello.
Please check last version. https://github.com/jaysalvat/ezdz/releases
$('#yourlink').on('click', function () {
$('input').ezdz('preview', null);
});
Will this be implemented?