From 15c54b6333def0ce3af18691803ebbb4d549e366 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Mon, 8 Oct 2007 20:01:06 +0000 Subject: [PATCH] photographer und owner werden mit dem de/aktivieren der entsprechenden Bloecke auch de/aktiviert --- css/fonts.css | 6 +++ js/personAdmin/personInUp.js | 63 +++++++++++------------- templates/personAdmin/personInUp.tpl.php | 18 ++++++- 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/css/fonts.css b/css/fonts.css index 55c19e5..6b9400a 100644 --- a/css/fonts.css +++ b/css/fonts.css @@ -25,6 +25,12 @@ font-weight: bold; color: #000000 } +.f-grp-head-unset1 { + font-family: verdana, sans-serif; + font-size: 10pt; + font-weight: bold; + color: #484848 +} .f-box-head1 { font-family: verdana, sans-serif; font-size: 10pt; diff --git a/js/personAdmin/personInUp.js b/js/personAdmin/personInUp.js index 3504e5d..edec637 100644 --- a/js/personAdmin/personInUp.js +++ b/js/personAdmin/personInUp.js @@ -35,42 +35,30 @@ function personInUp ( var blockElement = titleElement.parentNode; var dataElement = blockElement.getElementsByTagName ('div')[1]; - if (dataElement.style.display == 'none') + var insBox = document.getElementById (this.insBox); + var person = (insBox.checked == true)? this.newPerson: this.person; + + switch (titleId) { - dataElement.style.display = 'block'; - imgElement.src = arrDown.getImgUrl (titleElement); - - switch (titleId) - { - case 'title_photographer': - if (this.person._photographerId != -1) - this.person.photographerId = this.person._photographerId; - else - this.person.photographerId = 0; - break; + case 'title_photographer': + var id = 'photographerId'; + var _id = '_photographerId'; + break; - case 'title_owner': - if (this.person._ownerId != -1) - this.person.ownerId = this.person._ownerId; - else - this.person.ownerId = 0; - } + case 'title_owner': + var id = 'ownerId'; + var _id = '_ownerId'; } + + if (dataElement.style.display == 'none') + if (person[_id] != -1) + person[id] = person[_id]; + else + person[id] = 0; else - { - dataElement.style.display = 'none'; - imgElement.src = arrRight.getImgUrl (titleElement); - - switch (titleId) - { - case 'title_photographer': - this.person.photographerId = -1; - break; + person[id] = -1; - case 'title_owner': - this.person.ownerId = -1; - } - } + this.un_fold (person[id], dataElement) } this.de_activate = function (field) @@ -88,17 +76,26 @@ function personInUp ( this.un_fold = function (id, element) { - title = element.parentNode.getElementsByTagName ('div')[0]; - img = title.getElementsByTagName ('img')[0]; + var title = element.parentNode.getElementsByTagName ('div')[0]; + var img = title.getElementsByTagName ('img')[0]; + + var classes = ''; + var _classes = title.className.split (' '); + + for (c in _classes) + if (_classes[c][0] != 'f') + classes += ' ' + _classes[c]; if (id != -1) { element.style.display = 'block'; + title.className = classes + ' f-grp-head1'; img.src = this.arrDown.getImgUrl (title); } else { element.style.display = 'none'; + title.className = classes + ' f-grp-head-unset1'; img.src = this.arrRight.getImgUrl (title); } } diff --git a/templates/personAdmin/personInUp.tpl.php b/templates/personAdmin/personInUp.tpl.php index bfa8086..d3ea532 100644 --- a/templates/personAdmin/personInUp.tpl.php +++ b/templates/personAdmin/personInUp.tpl.php @@ -35,6 +35,20 @@ @@ -92,7 +106,7 @@
-
-