- Timestamp:
- Nov 20, 2010, 5:21:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/js/jsUtil.js
r568 r712 52 52 $(id).focus(); 53 53 } 54 55 function enableUtil(id) { 56 $(id).disabled = false; 57 } 58 59 function disableUtil(id) { 60 $(id).disabled = true; 61 } 62 63 // Looping in reverse is apparently more efficient. 64 function containsUtil(val, array) { 65 var i = array.length; 66 while (i--) { 67 if (array[i] == val) { 68 return true; 69 } 70 } 71 return false; 72 } 73 74 function toggleArrayUtil(idArray) { 75 var i = idArray.length; 76 while (i--) { 77 toggleUtil(idArray[i]); 78 } 79 } 80 81 // Loops forwards. 82 function showArrayUtil(idArray) { 83 var len = idArray.length 84 var i=0; 85 for (i=0; i < len; i++) { 86 Effect.Appear(idArray[i],{duration:0.1,queue:'end'}); 87 } 88 } 89 90 // Loops backwards. 91 function hideArrayUtil(idArray) { 92 var i = idArray.length; 93 while (i--) { 94 Effect.Fade(idArray[i],{duration:0.1,queue:'end'}); 95 } 96 } 97 98 function disableArrayUtil(idArray) { 99 var i = idArray.length; 100 while (i--) { 101 disableUtil(idArray[i]); 102 } 103 } 104 105 function enableArrayUtil(idArray) { 106 var i = idArray.length; 107 while (i--) { 108 enableUtil(idArray[i]); 109 } 110 } 111 112 function toggleIfArrayContainsValueUtil(toggleIds, val, array) { 113 if(containsUtil(val, array)) { 114 //Effect.multiple(toggleIds, Effect.Appear, {duration:0.4,queue:'end'}); // A little slow, will not go bellow 0.1 per item. 115 showArrayUtil(toggleIds); 116 } 117 else { 118 hideArrayUtil(toggleIds); 119 } 120 }
Note: See TracChangeset
for help on using the changeset viewer.