Module: check_mk
Branch: master
Commit: b25ac1ad7a2314a3510dcd3852bce2490dad2ff1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b25ac1ad7a2314…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 25 13:53:56 2011 +0100
Multisite: Fixed column editor forgetting uncommited changes
---
ChangeLog | 2 ++
web/htdocs/js/check_mk.js | 11 ++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6b1bd57..9e1cf2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@
mode (such as host or service detail)
* FIX: fix PNP icon in cases where host and service icons are displayed in
same view (found by Wolfgang Barth)
+ * FIX: Fixed view column editor forgetting pending changes to other form
+ fields
WATO:
* FIX: fix problem with vanishing services on Windows. Affected were services
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 050bf22..cec6c96 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -320,8 +320,17 @@ function column_swap_ids(o1, o2) {
}
function add_view_column_handler(id, code) {
+ // Can not simply add the new code to the innerHTML code of the target
+ // container. So first creating a temporary container and fetch the
+ // just created DOM node of the editor fields to add it to the real
+ // container afterwards.
+ var tmpContainer = document.createElement('div');
+ tmpContainer.innerHTML = code;
+ var oNewEditor = tmpContainer.lastChild;
+
var oContainer = document.getElementById('ed_'+id).firstChild;
- oContainer.innerHTML += code;
+ oContainer.appendChild(oNewEditor);
+ tmpContainer = null;
if (oContainer.lastChild.previousSibling)
fix_buttons(oContainer, oContainer.lastChild.previousSibling);