mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
parent
d961fa480a
commit
0fad66c452
53 changed files with 2231 additions and 1181 deletions
|
|
@ -8,7 +8,39 @@ function PopupsKeyboardShortcutsHelpViewModel()
|
|||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp');
|
||||
|
||||
this.sDefaultKeyScope = Enums.KeyState.PopupKeyboardShortcutsHelp;
|
||||
|
||||
Knoin.constructorEnd(this);
|
||||
}
|
||||
|
||||
Utils.extendAsViewModel('PopupsKeyboardShortcutsHelpViewModel', PopupsKeyboardShortcutsHelpViewModel);
|
||||
|
||||
PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
|
||||
{
|
||||
key('tab, shift+tab', Enums.KeyState.PopupKeyboardShortcutsHelp, _.bind(function (event, handler) {
|
||||
if (event && handler)
|
||||
{
|
||||
var
|
||||
$tabs = oDom.find('.nav.nav-tabs > li'),
|
||||
bNext = handler && 'tab' === handler.shortcut,
|
||||
iIndex = $tabs.index($tabs.filter('.active'))
|
||||
;
|
||||
|
||||
if (!bNext && iIndex > 0)
|
||||
{
|
||||
iIndex--;
|
||||
}
|
||||
else if (bNext && iIndex < $tabs.length - 1)
|
||||
{
|
||||
iIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
iIndex = bNext ? 0 : $tabs.length - 1;
|
||||
}
|
||||
|
||||
$tabs.eq(iIndex).find('a[data-toggle="tab"]').tab('show');
|
||||
return false;
|
||||
}
|
||||
}, this));
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue