[Nagvis-checkins] SF.net Git: nagvis: Bugfix: It is now possible to reset options to their default
Brought to you by:
larsi-
From: lars <la...@us...> - 2010-11-24 21:32:18
|
Module: nagvis Branch: master Commit: 2a6cb58a1af2c36e290937e25156bc233897567f URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=2a6cb58a1af2c36e290937e25156bc233897567f Author: Lars Michelsen <lm...@la...> Date: Wed Nov 24 17:24:08 2010 +0100 Bugfix: It is now possible to reset options to their default value using the addmodify dialog when they have been set before --- share/frontend/nagvis-js/js/ajax.js | 7 ++++--- share/server/core/classes/WuiViewMapAddModify.php | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/share/frontend/nagvis-js/js/ajax.js b/share/frontend/nagvis-js/js/ajax.js index 556484d..1997093 100644 --- a/share/frontend/nagvis-js/js/ajax.js +++ b/share/frontend/nagvis-js/js/ajax.js @@ -448,9 +448,10 @@ function getFormParams(formId) { for(var i = 0, len = aFields.length; i < len; i++) { // Filter helper fields (NagVis WUI specific) if(aFields[i].name.charAt(0) !== '_') { - // Skip options which use the default value - var oFieldDefault = document.getElementById('_'+aFields[i].name); - if(aFields[i] && oFieldDefault) { + // Skip options which use the default value and where the value has + // not been set before + var oFieldDefault = document.getElementById('_'+aFields[i].name); + if(aFields[i] && oFieldDefault && !document.getElementById('_conf_'+aFields[i].name)) { if(aFields[i].value === oFieldDefault.value) { continue; } diff --git a/share/server/core/classes/WuiViewMapAddModify.php b/share/server/core/classes/WuiViewMapAddModify.php index 3e83b8a..18c628f 100644 --- a/share/server/core/classes/WuiViewMapAddModify.php +++ b/share/server/core/classes/WuiViewMapAddModify.php @@ -222,6 +222,7 @@ class WuiViewMapAddModify { $ret .= $FORM->getHiddenField('_'.$propname, $this->MAPCFG->getValue($this->aOpts['type'], $this->aOpts['id'], $propname, FALSE)); } else { $ret .= $FORM->getHiddenField('_'.$propname, ''); + $ret .= $FORM->getHiddenField('_conf_'.$propname, $this->MAPCFG->getValue($this->aOpts['type'], $this->aOpts['id'], $propname, TRUE)); } // Set field type to show |