Update uploader view

Update image edit view
This commit is contained in:
mespeche
2013-09-23 12:30:34 +02:00
parent 7c563eda42
commit 1ea614be57
6 changed files with 247 additions and 495 deletions

View File

@@ -2,10 +2,14 @@ $(function($){
// Manage picture upload
var pictureUploadManager = {};
var imageDropzone = new Dropzone("#images-dropzone");
Dropzone.options.imageDropzone = {
uploadMultiple: false
};
Dropzone.autoDiscover = false;
var imageDropzone = new Dropzone("#images-dropzone", {
dictDefaultMessage : $('.btn-browse').html(),
uploadMultiple: false,
maxFilesize: 8
});
imageDropzone.on("success", function(file) {
$(".image-manager .dz-file-preview").remove();
imageDropzone.removeFile(file);
@@ -38,7 +42,9 @@ $(function($){
$('.image-manager .image-delete-btn').on('click', function (e) {
e.preventDefault();
var $this = $(this);
$this.parent().append('<div class="loading" ></div>');
var $parent = $this.parent();
$parent.find('a').remove();
$parent.append('<div class="loading" ></div>');
var $url = $this.attr("href");
var errorMessage = $this.attr("data-error-message");
$.ajax({
@@ -52,7 +58,8 @@ $(function($){
}
}
}).done(function(data) {
$this.parent().remove();
$parent.parents('tr').remove();
$(".image-manager .message").html(
data
);