added delete button to category image uploader in case you wanted to revert to bgColor

This commit is contained in:
psychobunny
2013-12-08 14:37:38 -05:00
parent 77e0cdcc3e
commit 07a3b3f00b
2 changed files with 19 additions and 2 deletions

View File

@@ -190,6 +190,20 @@ define(['uploader'], function(uploader) {
modified(inputEl);
});
});
$('.admin-categories').delegate('.delete-image', 'click', function() {
var parent = $(this).parents('li[data-cid]'),
inputEl = parent.find('.upload-button'),
preview = parent.find('.preview-box'),
bgColor = parent.find('.category_bgColor').val();
inputEl.value = '';
modified(inputEl);
preview.css('background', bgColor);
$(this).hide();
});
});
};