Fix box when no feed in category

See https://github.com/marienfressinaud/FreshRSS/issues/646
pull/654/head
Marien Fressinaud 10 years ago
parent 408ac31dd8
commit ce43b1761b
  1. 1
      app/views/helpers/javascript_vars.phtml
  2. 10
      p/scripts/category.js

@ -54,6 +54,7 @@ echo 'authType="', $authType, '",',
echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n";
echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n";
echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n";
echo 'str_category_empty="', Minz_Translate::t('category_empty'), '"', ",\n";
echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n";

@ -16,7 +16,12 @@ function dragend_process(t) {
t.style.display = 'block'; t.style.display = 'block';
t.style.opacity = 1.0; t.style.opacity = 1.0;
} else { } 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() { }).success(function() {
$(e.target).after(e.dataTransfer.getData('text/html')); $(e.target).after(e.dataTransfer.getData('text/html'));
if ($(e.target).hasClass('disabled')) {
$(e.target).remove();
}
dnd_successful = true; dnd_successful = true;
}).complete(function() { }).complete(function() {
loading = false; loading = false;

Loading…
Cancel
Save