mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Contacts tags support (unstable - step 1).
+ Small fixes
This commit is contained in:
parent
74fa12c000
commit
0ca00dec40
34 changed files with 1790 additions and 801 deletions
|
|
@ -17,7 +17,7 @@ function KnoinAbstractViewModel(sPosition, sTemplate)
|
|||
this.viewModelName = '';
|
||||
this.viewModelVisibility = ko.observable(false);
|
||||
this.modalVisibility = ko.observable(false).extend({'rateLimit': 0});
|
||||
|
||||
|
||||
this.viewModelDom = null;
|
||||
}
|
||||
|
||||
|
|
@ -72,14 +72,21 @@ KnoinAbstractViewModel.prototype.restoreKeyScope = function ()
|
|||
RL.data().keyScope(this.sCurrentKeyScope);
|
||||
};
|
||||
|
||||
KnoinAbstractViewModel.prototype.registerPopupEscapeKey = function ()
|
||||
KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
|
||||
{
|
||||
var self = this;
|
||||
$window.on('keydown', function (oEvent) {
|
||||
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility && self.modalVisibility())
|
||||
if (oEvent && self.modalVisibility && self.modalVisibility())
|
||||
{
|
||||
Utils.delegateRun(self, 'cancelCommand');
|
||||
return false;
|
||||
if (!this.bDisabeCloseOnEsc && Enums.EventKeyCode.Esc === oEvent.keyCode)
|
||||
{
|
||||
Utils.delegateRun(self, 'cancelCommand');
|
||||
return false;
|
||||
}
|
||||
else if (Enums.EventKeyCode.Backspace === oEvent.keyCode && !Utils.inFocus())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
|
|||
ViewModelClass.__builded = true;
|
||||
ViewModelClass.__vm = oViewModel;
|
||||
oViewModel.data = RL.data();
|
||||
|
||||
|
||||
oViewModel.viewModelName = ViewModelClass.__name;
|
||||
|
||||
if (oViewModelPlace && 1 === oViewModelPlace.length)
|
||||
|
|
@ -126,19 +126,19 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
|
|||
self.viewModelDom.hide();
|
||||
}, 300);
|
||||
}
|
||||
|
||||
|
||||
}, oViewModel);
|
||||
}
|
||||
|
||||
|
||||
Plugins.runHook('view-model-pre-build', [ViewModelClass.__name, oViewModel, oViewModelDom]);
|
||||
|
||||
ko.applyBindings(oViewModel, oViewModelDom[0]);
|
||||
Utils.delegateRun(oViewModel, 'onBuild', [oViewModelDom]);
|
||||
if (oViewModel && 'Popups' === sPosition && !oViewModel.bDisabeCloseOnEsc)
|
||||
if (oViewModel && 'Popups' === sPosition)
|
||||
{
|
||||
oViewModel.registerPopupEscapeKey();
|
||||
oViewModel.registerPopupKeyDown();
|
||||
}
|
||||
|
||||
|
||||
Plugins.runHook('view-model-post-build', [ViewModelClass.__name, oViewModel, oViewModelDom]);
|
||||
}
|
||||
else
|
||||
|
|
@ -240,7 +240,7 @@ Knoin.prototype.screenOnRoute = function (sScreenName, sSubPart)
|
|||
}
|
||||
|
||||
_.defer(function () {
|
||||
|
||||
|
||||
// hide screen
|
||||
if (self.oCurrentScreen)
|
||||
{
|
||||
|
|
@ -336,7 +336,7 @@ Knoin.prototype.startScreens = function (aScreensClasses)
|
|||
{
|
||||
oScreen.__started = true;
|
||||
oScreen.__start();
|
||||
|
||||
|
||||
Plugins.runHook('screen-pre-start', [oScreen.screenName(), oScreen]);
|
||||
Utils.delegateRun(oScreen, 'onStart');
|
||||
Plugins.runHook('screen-post-start', [oScreen.screenName(), oScreen]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue