[checkmk-commits] Check_MK Git: check_mk: #1984 FIX Fixed loosing sidebar after switching to /from edit mode in dashboard edior on page reload

Lars Michelsen lm at mathias-kettner.de
Wed Feb 18 11:31:02 CET 2015


Module: check_mk
Branch: master
Commit: d6492a3a1638b6aac4ea791ced42f9f0f78fd2ed
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6492a3a1638b6aac4ea791ced42f9f0f78fd2ed

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Wed Feb 18 11:30:54 2015 +0100

#1984 FIX Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload

When switching to/from edit mode in the dashboard editor, the URL was changed from index.py?...
to dashboard.py?... which made the sidebar disappear after reloading the page manually.

---

 .werks/1984                |   11 +++++++++++
 ChangeLog                  |    1 +
 web/htdocs/js/checkmk.js   |    6 ++++--
 web/htdocs/js/dashboard.js |    2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/.werks/1984 b/.werks/1984
new file mode 100644
index 0000000..2d9ac2f
--- /dev/null
+++ b/.werks/1984
@@ -0,0 +1,11 @@
+Title: Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424255344
+
+When switching to/from edit mode in the dashboard editor, the URL was changed from index.py?...
+to dashboard.py?... which made the sidebar disappear after reloading the page manually.
diff --git a/ChangeLog b/ChangeLog
index 9ed39f0..1b3c767 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -200,6 +200,7 @@
     * 1980 FIX: logwatch: Fixed exception when acknowledging errors of a single logfile on a single host
     * 1981 FIX: Not trying to render view in view editor when the view is not valid
     * 1983 FIX: Fixed special case in language configuration via user profile...
+    * 1984 FIX: Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload...
 
     WATO:
     * 1760 Added search form to manual checks page
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 6df55e0..ff8d68c 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -409,8 +409,10 @@ function getUrlParam(name, url) {
  * - Can add/overwrite parameters
  * - Removes _* parameters
  */
-function makeuri(addvars) {
-    var tmp = window.location.href.split('?');
+function makeuri(addvars, url) {
+    var url = (typeof(url) === 'undefined') ? window.location.href : url;
+
+    var tmp = url.split('?');
     var base = tmp[0];
     if(tmp.length > 1) {
         // Remove maybe existing anchors
diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js
index c18c33f..e697ddc 100644
--- a/web/htdocs/js/dashboard.js
+++ b/web/htdocs/js/dashboard.js
@@ -434,7 +434,7 @@ function toggle_dashboard_edit() {
     // Only a solution for browsers with history.replaceState support. Sadly
     // we have no F5/reload fix for others...
     if (window.parent.history.replaceState) {
-        new_url = makeuri({'edit': g_editing ? '1' : '0'});
+        new_url = makeuri({'edit': g_editing ? '1' : '0'}, window.parent.location.href);
         window.parent.history.replaceState({}, document.title, new_url);
     }
 



More information about the checkmk-commits mailing list