Skip to content
Snippets Groups Projects
Commit bb1862a5 authored by felmer's avatar felmer
Browse files

SSDM-3295: Fixing back button problem.

SVN: 35910
parent 98a940b6
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ function MainController(profile) { ...@@ -81,7 +81,7 @@ function MainController(profile) {
var viewName = queryString.viewName; var viewName = queryString.viewName;
var viewData = queryString.viewData var viewData = queryString.viewData
if(viewName && viewData) { if(viewName && viewData) {
localReference.changeView(viewName, viewData); localReference._changeView(viewName, viewData, false);
} }
} }
window.addEventListener("popstate", function(e) {backButtonLogic(e);}); window.addEventListener("popstate", function(e) {backButtonLogic(e);});
...@@ -156,6 +156,9 @@ function MainController(profile) { ...@@ -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 // 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 = function(newViewChange, arg) {
this._changeView(newViewChange, arg, true);
}
this._changeView = function(newViewChange, arg, shouldBePushToHistory) {
// //
// Dirty forms management, to avoid loosing changes. // Dirty forms management, to avoid loosing changes.
// //
...@@ -396,9 +399,11 @@ function MainController(profile) { ...@@ -396,9 +399,11 @@ function MainController(profile) {
// //
// Permanent URLs // Permanent URLs
// //
var menuUniqueId = this.sideMenu.getCurrentNodeId(); if (shouldBePushToHistory) {
var url = Util.getURLFor(menuUniqueId, newViewChange, arg); var menuUniqueId = this.sideMenu.getCurrentNodeId();
history.pushState(null, "", url); //History Push State var url = Util.getURLFor(menuUniqueId, newViewChange, arg);
history.pushState(null, "", url); //History Push State
}
// //
// Refresh Functionality // Refresh Functionality
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment