From 6ec81ace18ba8d72350599cb81bd38850eaa49cf Mon Sep 17 00:00:00 2001 From: Julius Date: Sun, 22 Sep 2013 22:04:29 +0200 Subject: [PATCH] Always show article category headers (do not unlist them on list.js search) --- app/assets/javascripts/list.unlist.js | 6 +++--- app/assets/stylesheets/list.unlist.css | 2 +- app/views/group_orders/_form.html.haml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/list.unlist.js b/app/assets/javascripts/list.unlist.js index f649369f..dc7101ed 100644 --- a/app/assets/javascripts/list.unlist.js +++ b/app/assets/javascripts/list.unlist.js @@ -136,9 +136,9 @@ List.prototype.templateEngines.unlist = function(list, settings) { $(item.elm).removeClass('unlisted'); }; this.hide = function(item) { - if (item.elm !== undefined) { - $(item.elm).addClass('unlisted'); - } + ensure.created(item); + $(item.elm).addClass('unlisted'); + listSource.appendChild(item.elm); }; this.clear = function() { $(listSource.childNodes).addClass('unlisted'); diff --git a/app/assets/stylesheets/list.unlist.css b/app/assets/stylesheets/list.unlist.css index b0ed4600..9fad9603 100644 --- a/app/assets/stylesheets/list.unlist.css +++ b/app/assets/stylesheets/list.unlist.css @@ -1,3 +1,3 @@ -.list .unlisted { +.list .unlisted:not(.no-unlist) { display: none; } \ No newline at end of file diff --git a/app/views/group_orders/_form.html.haml b/app/views/group_orders/_form.html.haml index dfac473f..64e88453 100644 --- a/app/views/group_orders/_form.html.haml +++ b/app/views/group_orders/_form.html.haml @@ -67,8 +67,8 @@ %th{style: "width:15px;"}= t '.sum' %tbody.list - @order.articles_grouped_by_category.each do |category, order_articles| - %tr.article-category - %td.name + %tr.no-unlist.article-category + %td = category %i.icon-tag %td{colspan: "9"}