summaryrefslogtreecommitdiffstats
path: root/usr/local/www/row_toggle.js
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-25 16:58:46 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-25 16:58:46 +0000
commit80cf44e9c9fac8f36420cd776bbee4b59bb915f0 (patch)
treea8c52fcf066559c229bcb26c7bb8e3c50704ee2a /usr/local/www/row_toggle.js
parentf4e6563a32f3b3e00bfe53ae69dfcffaa92e06c8 (diff)
downloadpfsense-80cf44e9c9fac8f36420cd776bbee4b59bb915f0.zip
pfsense-80cf44e9c9fac8f36420cd776bbee4b59bb915f0.tar.gz
MFC 7147
Dynamically figure out the number of 'frd' cells in a table This allows for different sized tables to use the row moving JS without looking ugly
Diffstat (limited to 'usr/local/www/row_toggle.js')
-rwxr-xr-xusr/local/www/row_toggle.js39
1 files changed, 21 insertions, 18 deletions
diff --git a/usr/local/www/row_toggle.js b/usr/local/www/row_toggle.js
index 1ae9240..0e7a786 100755
--- a/usr/local/www/row_toggle.js
+++ b/usr/local/www/row_toggle.js
@@ -24,28 +24,31 @@ function fr_insline(id, on) {
var prevrow = document.getElementById('frheader');
}
- var cells = row.getElementsByTagName("td");
+ var cells = row.getElementsByTagName("td");
var prevcells = prevrow.getElementsByTagName("td");
-
- for (i = 2; i <= 7; i++) {
- if (on) {
- prevcells[i].style.borderBottom = "3px solid #990000";
- prevcells[i].style.paddingBottom = (id != 0) ? 2 : 3;
- } else {
- prevcells[i].style.borderBottom = "1px solid #999999";
- prevcells[i].style.borderBottomWidth = "1px";
- prevcells[i].style.paddingBottom = (id != 0) ? 4 : 5;
+
+ for (i = 0; i <= prevcells.length - 1; i++) {
+ if (prevcells[i].id == 'frd' + (id-1)) {
+ if (on) {
+ prevcells[i].style.borderBottom = "3px solid #990000";
+ prevcells[i].style.paddingBottom = (id != 0) ? 2 : 3;
+ } else {
+ prevcells[i].style.borderBottom = "1px solid #999999";
+ prevcells[i].style.borderBottomWidth = "1px";
+ prevcells[i].style.paddingBottom = (id != 0) ? 4 : 5;
+ }
}
}
- for (i = 2; i <= 7; i++) {
- if (on) {
- cells[i].style.borderTop = "2px solid #990000";
- cells[i].style.paddingTop = 2;
- } else {
- prevcells[i].style.borderBottom = "1px solid #999999";
- cells[i].style.borderTopWidth = 0;
- cells[i].style.paddingTop = 4;
+ for (i = 0; i <= cells.length - 1; i++) {
+ if (cells[i].id == 'frd' + (id)) {
+ if (on) {
+ cells[i].style.borderTop = "2px solid #990000";
+ cells[i].style.paddingTop = 2;
+ } else {
+ cells[i].style.borderTopWidth = 0;
+ cells[i].style.paddingTop = 4;
+ }
}
}
}
OpenPOWER on IntegriCloud