stored view impr

This commit is contained in:
Yuri Kuznetsov
2024-05-18 11:47:18 +03:00
parent 2138591b72
commit eaaceb74bd
2 changed files with 16 additions and 5 deletions
+11 -5
View File
@@ -256,11 +256,14 @@ class Controller {
/**
* @param {string} key
* @param {string} [name]
* @return {string}
* @private
*/
_composeScrollKey(key) {
return `scrollTop-${this.name}-${key}`;
_composeScrollKey(key, name) {
name = name || this.name;
return `scrollTop-${name}-${key}`;
}
/**
@@ -453,8 +456,8 @@ class Controller {
*/
_unchainMainView(masterView) {
if (
!masterView.currentViewKey ||
!this.hasStoredMainView(masterView.currentViewKey)
!masterView.currentViewKey /*||
!this.hasStoredMainView(masterView.currentViewKey)*/
) {
return;
}
@@ -596,7 +599,9 @@ class Controller {
mainView.listenToOnce(this.baseController, 'action', onAction);
if (masterView.currentViewKey) {
this.set(this._composeScrollKey(masterView.currentViewKey), $(window).scrollTop());
const scrollKey = this._composeScrollKey(masterView.currentViewKey, masterView.currentName);
this.set(scrollKey, $(window).scrollTop());
if (!dto.isSet) {
this._unchainMainView(masterView);
@@ -604,6 +609,7 @@ class Controller {
}
masterView.currentViewKey = key;
masterView.currentName = this.name;
if (!dto.isSet) {
masterView.setView('main', mainView);
+5
View File
@@ -55,6 +55,11 @@ class MasterSiteView extends View {
*/
currentViewKey
/**
* @type {string}
*/
currentName
showLoadingNotification() {
Espo.Ui.notify(' ... ');
}