Special __constructor_end hook to extend js constructors.

This commit is contained in:
RainLoop Team 2013-12-09 19:16:58 +04:00
parent f7106f375c
commit f562d80985
29 changed files with 161 additions and 20 deletions

View file

@ -66,6 +66,8 @@ function AdminLoginViewModel()
}, function () {
return !this.submitRequest();
});
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('AdminLoginViewModel', AdminLoginViewModel);

View file

@ -11,6 +11,8 @@ function AdminMenuViewModel(oScreen)
KnoinAbstractViewModel.call(this, 'Left', 'AdminMenu');
this.menu = oScreen.menu;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('AdminMenuViewModel', AdminMenuViewModel);

View file

@ -10,6 +10,8 @@ function AdminPaneViewModel()
this.adminDomain = ko.observable(RL.settingsGet('AdminDomain'));
this.version = ko.observable(RL.settingsGet('Version'));
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('AdminPaneViewModel', AdminPaneViewModel);

View file

@ -156,6 +156,8 @@ function LoginViewModel()
return bF || bG || bT;
}, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('LoginViewModel', LoginViewModel);

View file

@ -14,6 +14,8 @@ function MailBoxFolderListViewModel()
this.iDropOverTimer = 0;
this.allowContacts = !!RL.settingsGet('ContactsIsAllowed');
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('MailBoxFolderListViewModel', MailBoxFolderListViewModel);

View file

@ -177,6 +177,8 @@ function MailBoxMessageListViewModel()
this.deleteCommand();
}
}, this));
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('MailBoxMessageListViewModel', MailBoxMessageListViewModel);

View file

@ -141,6 +141,8 @@ function MailBoxMessageViewViewModel()
this.messageActiveDom.subscribe(function () {
this.scrollMessageToTop();
}, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('MailBoxMessageViewViewModel', MailBoxMessageViewViewModel);

View file

@ -7,6 +7,7 @@
function MailBoxSystemDropDownViewModel()
{
AbstractSystemDropDownViewModel.call(this);
Knoin.constructorEnd(this);
}
_.extend(MailBoxSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype);
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);

View file

@ -82,6 +82,8 @@ function PopupsActivateViewModel()
}, function () {
return !this.activateProcess() && '' !== this.domain() && '' !== this.key() && !this.activationSuccessed();
});
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsActivateViewModel', PopupsActivateViewModel);

View file

@ -82,6 +82,8 @@ function PopupsAddAccountViewModel()
this.login(this.email());
}
}, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsAddAccountViewModel', PopupsAddAccountViewModel);

View file

@ -27,6 +27,8 @@ function PopupsAdvancedSearchViewModel()
this.cancelCommand();
});
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsAdvancedSearchViewModel', PopupsAdvancedSearchViewModel);

View file

@ -397,6 +397,8 @@ function PopupsComposeViewModel()
});
// this.driveCallback = _.bind(this.driveCallback, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsComposeViewModel', PopupsComposeViewModel);

View file

@ -236,6 +236,8 @@ function PopupsContactsViewModel()
});
this.bDropPageAfterDelete = false;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsContactsViewModel', PopupsContactsViewModel);

View file

@ -109,6 +109,8 @@ function PopupsDomainViewModel()
this.whiteListCommand = Utils.createCommand(this, function () {
this.whiteListPage(!this.whiteListPage());
});
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsDomainViewModel', PopupsDomainViewModel);

View file

@ -75,6 +75,8 @@ function PopupsFolderClearViewModel()
return !bIsClearing && null !== oFolder;
});
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsFolderClearViewModel', PopupsFolderClearViewModel);

View file

@ -80,6 +80,8 @@ function PopupsFolderCreateViewModel()
});
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsFolderCreateViewModel', PopupsFolderCreateViewModel);

View file

@ -66,6 +66,8 @@ function PopupsFolderSystemViewModel()
this.trashFolder.subscribe(fCallback);
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsFolderSystemViewModel', PopupsFolderSystemViewModel);

View file

@ -94,6 +94,8 @@ function PopupsIdentityViewModel()
this.button = ko.computed(function () {
return Utils.i18n('POPUPS_IDENTITIES/' + (this.edit() ? 'BUTTON_UPDATE_IDENTITY': 'BUTTON_ADD_IDENTITY'));
}, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsIdentityViewModel', PopupsIdentityViewModel);

View file

@ -23,6 +23,8 @@ function PopupsLanguagesViewModel()
RL.data().mainLanguage.subscribe(function () {
this.resetMainLanguage();
}, this);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsLanguagesViewModel', PopupsLanguagesViewModel);

View file

@ -58,6 +58,8 @@ function PopupsPluginViewModel()
RL.remote().pluginSettingsUpdate(this.onPluginSettingsUpdateResponse, oList);
}, this.hasConfiguration);
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsPluginViewModel', PopupsPluginViewModel);

View file

@ -11,6 +11,8 @@ function SettingsMenuViewModel(oScreen)
KnoinAbstractViewModel.call(this, 'Left', 'SettingsMenu');
this.menu = oScreen.menu;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('SettingsMenuViewModel', SettingsMenuViewModel);

View file

@ -7,6 +7,8 @@
function SettingsPaneViewModel()
{
KnoinAbstractViewModel.call(this, 'Right', 'SettingsPane');
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('SettingsPaneViewModel', SettingsPaneViewModel);

View file

@ -7,6 +7,7 @@
function SettingsSystemDropDownViewModel()
{
AbstractSystemDropDownViewModel.call(this);
Knoin.constructorEnd(this);
}
_.extend(SettingsSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype);
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);