From 07a3b3f00bda93392a72e48be86c3202e9c1b351 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sun, 8 Dec 2013 14:37:38 -0500 Subject: [PATCH] added delete button to category image uploader in case you wanted to revert to bgColor --- public/src/forum/admin/categories.js | 14 ++++++++++++++ public/templates/admin/categories.tpl | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js index 48fd65504a..fd6e4dc173 100644 --- a/public/src/forum/admin/categories.js +++ b/public/src/forum/admin/categories.js @@ -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(); + }); }); }; diff --git a/public/templates/admin/categories.tpl b/public/templates/admin/categories.tpl index fe265658f8..a8da120e82 100644 --- a/public/templates/admin/categories.tpl +++ b/public/templates/admin/categories.tpl @@ -14,12 +14,15 @@
  • -