From bb1862a5f6c59300c46b14713a5aaaabe751cc85 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 15 Mar 2016 14:32:50 +0000 Subject: [PATCH] SSDM-3295: Fixing back button problem. SVN: 35910 --- .../eln-lims/html/js/controllers/MainController.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index 604588c75e0..edbcea8e94c 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -81,7 +81,7 @@ function MainController(profile) { var viewName = queryString.viewName; var viewData = queryString.viewData if(viewName && viewData) { - localReference.changeView(viewName, viewData); + localReference._changeView(viewName, viewData, false); } } window.addEventListener("popstate", function(e) {backButtonLogic(e);}); @@ -156,6 +156,9 @@ function MainController(profile) { // Main View Changer - Everything on the application rely on this method to alter the views, arg should be a string // this.changeView = function(newViewChange, arg) { + this._changeView(newViewChange, arg, true); + } + this._changeView = function(newViewChange, arg, shouldBePushToHistory) { // // Dirty forms management, to avoid loosing changes. // @@ -396,9 +399,11 @@ function MainController(profile) { // // Permanent URLs // - var menuUniqueId = this.sideMenu.getCurrentNodeId(); - var url = Util.getURLFor(menuUniqueId, newViewChange, arg); - history.pushState(null, "", url); //History Push State + if (shouldBePushToHistory) { + var menuUniqueId = this.sideMenu.getCurrentNodeId(); + var url = Util.getURLFor(menuUniqueId, newViewChange, arg); + history.pushState(null, "", url); //History Push State + } // // Refresh Functionality // -- GitLab