- Web UI: Display selected filter as selected

This commit is contained in:
Christophe Dumez
2009-11-23 13:56:10 +00:00
parent 34ba69e319
commit a83744289f
4 changed files with 23 additions and 7 deletions

View File

@@ -130,7 +130,12 @@ hr {
list-style-type: none;
}
#Filters ul li {
margin-left: -16px;
}
#Filters ul img {
padding-left: 4px;
padding-right: 2px;
margin-top: 2px;
}
@@ -139,3 +144,7 @@ hr {
vertical-align: top;
}
.selectedFilter {
background-color: #354158;
color: #000;
}

View File

@@ -75,11 +75,11 @@
<table>
<tr><td id="Filters">
<ul>
<li><a href="#" onclick="setFilter('all');"><img src="images/oxygen/folder.png"/>_(All)</li>
<li><a href="#" onclick="setFilter('downloading');"><img src="images/skin/downloading.png"/>_(Downloading)</li>
<li><a href="#" onclick="setFilter('completed');"><img src="images/skin/seeding.png"/>_(Completed)</li>
<li><a href="#" onclick="setFilter('active');"><img src="images/oxygen/draw-triangle2.png"/>_(Active)</li>
<li><a href="#" onclick="setFilter('inactive');"><img src="images/oxygen/draw-rectangle.png"/>_(Inactive)</li>
<li class="selectedFilter" id="all_filter"><a href="#" onclick="setFilter('all');"><img src="images/oxygen/folder.png"/>_(All)</li>
<li id="downloading_filter"><a href="#" onclick="setFilter('downloading');"><img src="images/skin/downloading.png"/>_(Downloading)</li>
<li id="completed_filter"><a href="#" onclick="setFilter('completed');"><img src="images/skin/seeding.png"/>_(Completed)</li>
<li id="active_filter"><a href="#" onclick="setFilter('active');"><img src="images/oxygen/draw-triangle2.png"/>_(Active)</li>
<li id="inactive_filter"><a href="#" onclick="setFilter('inactive');"><img src="images/oxygen/draw-rectangle.png"/>_(Inactive)</li>
</ul>
</td>
<td id="Transfers">

View File

@@ -129,6 +129,13 @@ window.addEvent('domready', function(){
// ajaxfn.periodical(5000);
setFilter = function(f) {
// Visually Select the right filter
$("all_filter").removeClass("selectedFilter");
$("downloading_filter").removeClass("selectedFilter");
$("completed_filter").removeClass("selectedFilter");
$("active_filter").removeClass("selectedFilter");
$("inactive_filter").removeClass("selectedFilter");
$(f+"_filter").addClass("selectedFilter");
myTable.setFilter(f);
ajaxfn();
}