fixes #1958 - Title does not reset on home browse (Web Interface)
This commit is contained in:
+38
-53
@@ -35,8 +35,6 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
|
||||
|
||||
function onViewChange(view, options, isRestore) {
|
||||
|
||||
var viewType = options.type;
|
||||
|
||||
var lastView = currentView;
|
||||
if (lastView) {
|
||||
dispatchViewEvent(lastView, 'viewhide');
|
||||
@@ -123,67 +121,54 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
|
||||
//events.on(connectionManager, 'localusersignedin', resetCachedViews);
|
||||
//events.on(connectionManager, 'localusersignedout', resetCachedViews);
|
||||
|
||||
function tryRestoreInternal(viewcontainer, options, resolve, reject) {
|
||||
function ViewManager() {
|
||||
}
|
||||
|
||||
ViewManager.prototype.loadView = function (options) {
|
||||
|
||||
var lastView = currentView;
|
||||
|
||||
// Record the element that has focus
|
||||
if (lastView) {
|
||||
lastView.activeElement = document.activeElement;
|
||||
}
|
||||
|
||||
if (options.cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
viewcontainer.tryRestoreView(options).then(function (view) {
|
||||
viewcontainer.loadView(options).then(function (view) {
|
||||
|
||||
onViewChange(view, options);
|
||||
});
|
||||
};
|
||||
|
||||
ViewManager.prototype.tryRestoreView = function (options, onViewChanging) {
|
||||
|
||||
if (options.cancel) {
|
||||
return Promise.reject({ cancelled: true });
|
||||
}
|
||||
|
||||
// Record the element that has focus
|
||||
if (currentView) {
|
||||
currentView.activeElement = document.activeElement;
|
||||
}
|
||||
|
||||
return viewcontainer.tryRestoreView(options).then(function (view) {
|
||||
|
||||
onViewChanging();
|
||||
onViewChange(view, options, true);
|
||||
resolve();
|
||||
|
||||
}, reject);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function ViewManager() {
|
||||
ViewManager.prototype.currentView = function () {
|
||||
return currentView;
|
||||
};
|
||||
|
||||
var self = this;
|
||||
|
||||
self.loadView = function (options) {
|
||||
|
||||
var lastView = currentView;
|
||||
|
||||
// Record the element that has focus
|
||||
if (lastView) {
|
||||
lastView.activeElement = document.activeElement;
|
||||
}
|
||||
|
||||
if (options.cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
viewcontainer.loadView(options).then(function (view) {
|
||||
|
||||
onViewChange(view, options);
|
||||
});
|
||||
};
|
||||
|
||||
self.tryRestoreView = function (options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
if (options.cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Record the element that has focus
|
||||
if (currentView) {
|
||||
currentView.activeElement = document.activeElement;
|
||||
}
|
||||
|
||||
tryRestoreInternal(viewcontainer, options, resolve, reject);
|
||||
});
|
||||
};
|
||||
|
||||
self.currentView = function () {
|
||||
return currentView;
|
||||
};
|
||||
|
||||
self.dispatchPageEvents = function (value) {
|
||||
dispatchPageEvents = value;
|
||||
};
|
||||
}
|
||||
ViewManager.prototype.dispatchPageEvents = function (value) {
|
||||
dispatchPageEvents = value;
|
||||
};
|
||||
|
||||
return new ViewManager();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user