]> err.no Git - scalable-opengroupware.org/blob - SOGo/UI/WebServerResources/UIxMailListView.js
39414f2a9dd89d377984e11a19a3ac48532bca24
[scalable-opengroupware.org] / SOGo / UI / WebServerResources / UIxMailListView.js
1 var rowSelectionCount = 0;
2
3 validateControls();
4
5 function showElement(e, shouldShow) {
6         e.style.display = shouldShow ? "" : "none";
7 }
8
9 function enableElement(e, shouldEnable) {
10   if(!e)
11     return;
12   if(shouldEnable) {
13     if(e.hasAttribute("disabled"))
14       e.removeAttribute("disabled");
15   }
16   else {
17     e.setAttribute("disabled", "1");
18   }
19 }
20
21 function toggleRowSelectionStatus(sender) {
22   rowID = sender.value;
23   tr = document.getElementById(rowID);
24   if(sender.checked) {
25     tr.className = "tableview_selected";
26     rowSelectionCount += 1;
27   }
28   else {
29     tr.className = "tableview";
30     rowSelectionCount -= 1;
31   }
32   this.validateControls();
33 }
34
35 function validateControls() {
36   var e = document.getElementById("moveto");
37   this.enableElement(e, rowSelectionCount > 0);
38 }
39
40 function moveTo(uri) {
41   alert("MoveTo: " + uri);
42 }