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
This commit is contained in:
David Huynh 2010-10-18 20:05:58 +00:00
parent 83e94d240c
commit 69b7d34e09
3 changed files with 19 additions and 6 deletions

View File

@ -1 +1 @@
<a class="history-entry"><span class="history-entry-index" bind="index"></span></a>
<a class="history-entry"><span class="history-entry-index"></span><span></span></a>

View File

@ -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");
}
});
}
});

View File

@ -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;
}