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
|
||||
|
||||
|
||||
@@ -37,7 +37,16 @@
|
||||
<div class="store-logo">
|
||||
<img src="{{ config('site_config.images_directory') . 'cliparts/' . $clipart->SVGFilename }}" width="100%" style="height: inherit;">
|
||||
</div>
|
||||
<hr style="margin-bottom: 0px !important;">
|
||||
|
||||
<div style="margin-bottom: 10px; border-bottom: 1px solid #eee;">
|
||||
<small style="color: #848484;"><b>Category:</b> <br>{{ $clipart->CategoryName }}</small>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<button data-id="{{ $clipart->Id }}" class="btn btn-danger btn-block delete-clipart"><i class="fa fa-trash"></i> Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{-- <li class="col-sm-2">
|
||||
<a class="thumbnail"></a>
|
||||
|
||||
Reference in New Issue
Block a user