mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Cleanup calls to Knockout observableArray
Improved Knockout observableArray
This commit is contained in:
parent
fa5476e486
commit
b6f0b634fb
47 changed files with 251 additions and 276 deletions
|
|
@ -11,7 +11,7 @@ export class AbstractScreen {
|
|||
/**
|
||||
* @returns {Array}
|
||||
*/
|
||||
viewModels() {
|
||||
get viewModels() {
|
||||
return this.aViewModels;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -263,8 +263,8 @@ function screenOnRoute(screenName, subPart) {
|
|||
if (!vmScreen.__builded) {
|
||||
vmScreen.__builded = true;
|
||||
|
||||
if (isNonEmptyArray(vmScreen.viewModels())) {
|
||||
vmScreen.viewModels().forEach(ViewModelClass => {
|
||||
if (vmScreen.viewModels.length) {
|
||||
vmScreen.viewModels.forEach(ViewModelClass => {
|
||||
buildViewModel(ViewModelClass, vmScreen);
|
||||
});
|
||||
}
|
||||
|
|
@ -278,8 +278,8 @@ function screenOnRoute(screenName, subPart) {
|
|||
currentScreen.onHide && currentScreen.onHide();
|
||||
currentScreen.onHideWithDelay && setTimeout(()=>currentScreen.onHideWithDelay(), 500);
|
||||
|
||||
if (isNonEmptyArray(currentScreen.viewModels())) {
|
||||
currentScreen.viewModels().forEach(ViewModelClass => {
|
||||
if (isNonEmptyArray(currentScreen.viewModels)) {
|
||||
currentScreen.viewModels.forEach(ViewModelClass => {
|
||||
if (
|
||||
ViewModelClass.__vm &&
|
||||
ViewModelClass.__dom &&
|
||||
|
|
@ -302,8 +302,8 @@ function screenOnRoute(screenName, subPart) {
|
|||
if (currentScreen && !isSameScreen) {
|
||||
currentScreen.onShow && currentScreen.onShow();
|
||||
|
||||
if (isNonEmptyArray(currentScreen.viewModels())) {
|
||||
currentScreen.viewModels().forEach(ViewModelClass => {
|
||||
if (isNonEmptyArray(currentScreen.viewModels)) {
|
||||
currentScreen.viewModels.forEach(ViewModelClass => {
|
||||
if (
|
||||
ViewModelClass.__vm &&
|
||||
ViewModelClass.__dom &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue