From 69b7d34e09af4e7beb87dd8da9fa88e1fbc38186 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Mon, 18 Oct 2010 20:05:58 +0000 Subject: [PATCH] Reduce filtered out history items' heights rather than hiding them entirely git-svn-id: http://google-refine.googlecode.com/svn/trunk@1606 7d457c2a-affb-35e4-300a-418c747d4874 --- .../core/scripts/project/history-entry.html | 2 +- .../modules/core/scripts/project/history-panel.js | 14 +++++++++----- .../modules/core/styles/project/sidebar.less | 9 +++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/main/webapp/modules/core/scripts/project/history-entry.html b/main/webapp/modules/core/scripts/project/history-entry.html index 1ccd60484..020e72fc0 100644 --- a/main/webapp/modules/core/scripts/project/history-entry.html +++ b/main/webapp/modules/core/scripts/project/history-entry.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/project/history-panel.js b/main/webapp/modules/core/scripts/project/history-panel.js index b5b2b66e9..2322dfa80 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.js +++ b/main/webapp/modules/core/scripts/project/history-panel.js @@ -65,8 +65,8 @@ HistoryPanel.prototype._render = function() { }); } - a[0].appendChild(document.createTextNode(entry.description)); - a[0].firstChild.appendChild(document.createTextNode(index + ".")); + a[0].childNodes[0].appendChild(document.createTextNode(index + ".")); + a[0].childNodes[1].appendChild(document.createTextNode(entry.description)); return a; }; @@ -101,11 +101,15 @@ HistoryPanel.prototype._render = function() { elmts.filterInput.keyup(function() { var filter = $.trim(this.value.toLowerCase()); if (filter.length == 0) { - elmts.bodyDiv.find(".history-entry").show(); + elmts.bodyDiv.find(".history-entry").removeClass("filtered-out"); } else { elmts.bodyDiv.find(".history-entry").each(function() { - var text = this.childNodes[1].nodeValue; - this.style.display = (text.toLowerCase().indexOf(filter) >= 0) ? "block" : "none"; + var text = this.childNodes[1].firstChild.nodeValue; + if (text.toLowerCase().indexOf(filter) >= 0) { + $(this).removeClass("filtered-out"); + } else { + $(this).addClass("filtered-out"); + } }); } }); diff --git a/main/webapp/modules/core/styles/project/sidebar.less b/main/webapp/modules/core/styles/project/sidebar.less index 7398e9e75..40cfe94f8 100644 --- a/main/webapp/modules/core/styles/project/sidebar.less +++ b/main/webapp/modules/core/styles/project/sidebar.less @@ -142,6 +142,15 @@ a.history-entry { color: black; border-top: 1px dotted #ddd; } +a.history-entry.filtered-out { + height: 1px; + padding-top: 2px; + padding-bottom: 2px; +} +a.history-entry.filtered-out > * { + display: none; +} + .history-future a.history-entry, .history-future a.history-entry-index { color: @light_grey; }