Salome HOME
Duplicated menu after a second study opening is fixed.
[tools/siman.git] / Workspace / Siman / WebContent / jvs / search.js
1     function initialize (result) {
2 //  ----------------------------
3       var state = search.state.value;
4
5       if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") {
6         search.visibility[0].checked  = true;        
7         search.visibility[1].disabled = true;
8         search.visibility[2].disabled = true;
9       }
10       if (result == "obsolete") changeFilter();   // Hides the result section and enables the Search button
11     }
12
13     function setState () {
14 //  --------------------
15       var state = search.state.value;
16
17       if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") {
18         search.visibility[0].checked  = true;        
19         search.visibility[1].disabled = true;
20         search.visibility[2].disabled = true;
21       } else if (search.visibility[1].value != "onlypublic") {
22         search.visibility[1].disabled = false;
23         search.visibility[2].disabled = false;
24       }
25       changeFilter();
26     }
27
28     function changeFilter () {
29 //  ------------------------
30       var result = document.getElementById("resulist");
31
32       search.elements[0].value = "0";      // Marks the result obsolete
33       result.style.display     = "none";   // Hides the result section
34       search.refresh.disabled  = false;    // Enables the Search button
35     }
36
37     function removeContext (index) {
38 //  ------------------------------
39         search.elements[0].value = index;
40         search.submit();
41     }
42
43     function cancel () {
44 //  ------------------
45       search.elements[0].value = "-1";
46       search.submit();
47     }