added delete button for clipart
This commit is contained in:
@@ -471,6 +471,7 @@ desired effect
|
||||
$('.available-colors').append('<button type="button" data-id="' + id + '" data-orig-color="'+fill+'" id="btn_' + id + '" data-toggle="popover" title="HEX Color" data-content="' + fill + '" class="btn btn-default change_color" style="background-color:' + fill + '"></button>');
|
||||
|
||||
}
|
||||
console.log(obj);
|
||||
$('.available-colors').append('</div></div>');
|
||||
|
||||
$('.additional-info').css("display", "block");
|
||||
@@ -1249,6 +1250,39 @@ desired effect
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('button click', '.delete-clipart', function() {
|
||||
|
||||
if (!confirm("Are you sure you want to delete this Clipart?")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var clipart_id = $(this).data('id');
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "{{ url('admin/clipart/delete') }}",
|
||||
data : {
|
||||
id: clipart_id
|
||||
},
|
||||
beforeSend: function(xhr){
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
},
|
||||
success : function(response){
|
||||
console.log(response)
|
||||
if(response.success){
|
||||
alert(response.message);
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}); // end document ready
|
||||
|
||||
|
||||
Reference in New Issue
Block a user