show if filter is active
This commit is contained in:
parent
cf396b17e1
commit
7d69416013
8
.gitignore
vendored
8
.gitignore
vendored
@ -3,3 +3,11 @@
|
||||
connectsql.php
|
||||
pChart2.1.3
|
||||
graph
|
||||
testpages.html
|
||||
js/newpages.js
|
||||
img/TropicalSunnyDay/TropicalSunnyDayBack2048.png
|
||||
img/TropicalSunnyDay/TropicalSunnyDayDown2048.png
|
||||
img/TropicalSunnyDay/TropicalSunnyDayFront2048.png
|
||||
img/TropicalSunnyDay/TropicalSunnyDayLeft2048.png
|
||||
img/TropicalSunnyDay/TropicalSunnyDayRight2048.png
|
||||
img/TropicalSunnyDay/TropicalSunnyDayUp2048.png
|
||||
|
@ -60,8 +60,8 @@
|
||||
?
|
||||
</output>
|
||||
|
|
||||
<button class="toolbarelem" onclick="showfilter()">
|
||||
Filter / Search
|
||||
<button id="schowfilter" class="toolbarelem" onclick="showfilter()">
|
||||
Filter / Search <b id="filterstate"></b>
|
||||
</button>
|
||||
<button title="Settings" onclick="settings.showHide()"><img src="/img/configure.png">
|
||||
</button>
|
||||
|
21
js/main.js
21
js/main.js
@ -570,6 +570,11 @@ function anchor() {
|
||||
oldhash = newhash;
|
||||
//URIHash.load();
|
||||
getSkins(URIHash.get('page','1'));
|
||||
document.getElementById("ids").value = URIHash.get('id','');
|
||||
document.getElementById("name").value = URIHash.get('name','');
|
||||
document.getElementById("license").value = URIHash.get('license','');
|
||||
document.getElementById("author").value = URIHash.get('author','');
|
||||
refreshFilterState();
|
||||
};
|
||||
checkAnchor = setTimeout(anchor, 500);
|
||||
};
|
||||
@ -628,6 +633,22 @@ function changeFilter(form){
|
||||
if(author !="") load.author = author;
|
||||
if(license !="") load.license = license;
|
||||
URIHash.load(load);
|
||||
refreshFilterState();
|
||||
}
|
||||
function isFilterActive(){
|
||||
return location.hash.length >= 8;//must be improved
|
||||
}
|
||||
|
||||
function refreshFilterState(){
|
||||
var elem = document.getElementById("filterstate");
|
||||
if(isFilterActive()){
|
||||
elem.style.color = "red";
|
||||
elem.innerHTML= "active";
|
||||
}
|
||||
else{
|
||||
elem.style.color = "green";
|
||||
elem.innerHTML = "inactive";
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user