summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-02 19:47:02 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-02 19:47:02 +0200
commitce43b1761b810c89e5e8660e8ae2638e97ca6339 (patch)
treedc4d73a2b9e090c3aa8c4fbec9799961244b26a9 /p
parent408ac31dd8751eba037db216243958d396df1c8e (diff)
Fix box when no feed in category
See https://github.com/marienfressinaud/FreshRSS/issues/646
Diffstat (limited to 'p')
-rw-r--r--p/scripts/category.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/p/scripts/category.js b/p/scripts/category.js
index 872d14490..dc5df67e4 100644
--- a/p/scripts/category.js
+++ b/p/scripts/category.js
@@ -16,7 +16,12 @@ function dragend_process(t) {
t.style.display = 'block';
t.style.opacity = 1.0;
} else {
- t.parentNode.removeChild(t);
+ var parent = $(t.parentNode);
+ $(t).remove();
+
+ if (parent.children().length <= 0) {
+ parent.append('<li class="item disabled" dropzone="move">' + str_category_empty + '</li>');
+ }
}
}
@@ -89,6 +94,9 @@ function init_draggable() {
}
}).success(function() {
$(e.target).after(e.dataTransfer.getData('text/html'));
+ if ($(e.target).hasClass('disabled')) {
+ $(e.target).remove();
+ }
dnd_successful = true;
}).complete(function() {
loading = false;