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 <[email protected]> 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 ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
