Dropdown menu keyboard navigation

Keyboard shortcuts help popup (Shift + / )
This commit is contained in:
RainLoop Team 2014-04-12 05:05:57 +04:00
parent f52be6fb66
commit d961fa480a
47 changed files with 5598 additions and 583 deletions

View file

@ -13,8 +13,9 @@ function AbstractSystemDropDownViewModel()
this.accounts = oData.accounts;
this.accountEmail = oData.accountEmail;
this.accountsLoading = oData.accountsLoading;
this.accountMenuFocus = oData.accountMenuFocus;
this.accountMenuDropdownTrigger = ko.observable(false);
this.allowAddAccount = RL.settingsGet('AllowAdditionalAccounts');
this.loading = ko.computed(function () {
@ -22,14 +23,6 @@ function AbstractSystemDropDownViewModel()
}, this);
this.accountClick = _.bind(this.accountClick, this);
key('`', function () {
if (oData.useKeyboardShortcuts() && !RL.popupVisibility() &&
!oData.accountMenuFocus())
{
oData.accountMenuFocus(true);
}
});
}
_.extend(AbstractSystemDropDownViewModel.prototype, KnoinAbstractViewModel.prototype);
@ -76,4 +69,15 @@ AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
RL.loginAndLogoutReload(true, RL.settingsGet('ParentEmail') && 0 < RL.settingsGet('ParentEmail').length);
});
};
};
AbstractSystemDropDownViewModel.prototype.onBuild = function ()
{
var self = this;
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
if (RL.data().useKeyboardShortcuts() && !RL.popupVisibility() && !Globals.dropdownVisibility() && self.viewModelVisibility())
{
self.accountMenuDropdownTrigger(true);
}
});
};