set a startup variable. unset it with the first call of the photo index page
[phpfspot.git] / phpfspot.js
index a7b830f9c4828fafa9496c26098655ab120f7992..2d7e780c4cf7b4a63400d2dceb7c03a0a75191ae 100644 (file)
@@ -22,6 +22,7 @@ function Tags(mode, id)
    }
    else if(mode == "reset") {
       HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
+      clearSearch();
    }
    else if(mode == "condition") {
       setCheckedValue(id, id.value);
@@ -66,8 +67,9 @@ function showBubbleDetails(object, id, direction)
 // if photo index is currently shown, refresh it
 function refreshPhotoIndex()
 {
-   if(document.getElementById("matrix") != undefined) {
+   if(document.getElementById("matrix") != undefined || startup == 1) {
       showPhotoIndex();
+      startup = 0;
    }
 }
 
@@ -110,3 +112,5 @@ function clearSearch()
 {
    document.getElementsByName('searchfor')[0].value = '';
 }
+
+var startup = 1;