mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Small fixes and code refactoring
This commit is contained in:
parent
e6c712862d
commit
1a85330770
67 changed files with 413 additions and 181 deletions
|
|
@ -6,6 +6,7 @@
|
|||
var
|
||||
_ = require('_'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Globals = require('Common/Globals'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
|
@ -37,6 +38,39 @@
|
|||
return '#/' + sRoute;
|
||||
};
|
||||
|
||||
MenuSettingsAdminView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
key('up, down', _.throttle(function (event, handler) {
|
||||
|
||||
var
|
||||
sH = '',
|
||||
iIndex = -1,
|
||||
bUp = handler && 'up' === handler.shortcut,
|
||||
$items = $('.b-admin-menu .e-item', oDom)
|
||||
;
|
||||
|
||||
if (event && $items.length)
|
||||
{
|
||||
iIndex = $items.index($items.filter('.selected'));
|
||||
if (bUp && iIndex > 0)
|
||||
{
|
||||
iIndex--;
|
||||
}
|
||||
else if (!bUp && iIndex < $items.length - 1)
|
||||
{
|
||||
iIndex++;
|
||||
}
|
||||
|
||||
sH = $items.eq(iIndex).attr('href');
|
||||
if (sH)
|
||||
{
|
||||
kn.setHash(sH, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
}, 200));
|
||||
};
|
||||
|
||||
module.exports = MenuSettingsAdminView;
|
||||
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue