app/assets/javascripts/activeadmin-selleo-cms/custom.js in activeadmin-selleo-cms-0.0.8 vs app/assets/javascripts/activeadmin-selleo-cms/custom.js in activeadmin-selleo-cms-0.0.9
- old
+ new
@@ -14,9 +14,20 @@
.replace(/-+/g, '-'); // collapse dashes
return str;
};
+function delete_asset(page_id, asset_id) {
+ $.ajax({
+ url: '/admin/pages/' + page_id + '/assets/' + asset_id + '.js',
+ type: 'DELETE'
+ }).success(function(){
+ $('[data-attachment-id="' + asset_id + '"]').remove();
+ }).error(function(){
+ alert('Could not delete attachment');
+ });
+}
+
$(function(){
$('#translations.index input').blur(function(evt){
$.ajax({
url: $(evt.target).data('route') + '.js',
type: 'PUT',
\ No newline at end of file