forked from 0x2620/pandora
use shift-[1-0] to switch between item views, fixes #2837
This commit is contained in:
parent
d16bbf6ba8
commit
cc9464082f
1 changed files with 12 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
pandora.ui.mainMenu = function() {
|
||||
var isGuest = pandora.user.level == 'guest',
|
||||
itemViewKey = 1,
|
||||
ui = pandora.user.ui,
|
||||
findState = pandora.getFindState(ui.find),
|
||||
fromMenu = false,
|
||||
|
@ -113,6 +114,9 @@ pandora.ui.mainMenu = function() {
|
|||
return Ox.extend({
|
||||
checked: ui.itemView == view.id
|
||||
}, view, {
|
||||
keyboard: itemViewKey <= 10
|
||||
? 'shift ' + (itemViewKey++%10)
|
||||
: void 0,
|
||||
title: Ox._(view.title)
|
||||
});
|
||||
}) },
|
||||
|
@ -861,6 +865,14 @@ pandora.ui.mainMenu = function() {
|
|||
}
|
||||
});
|
||||
|
||||
pandora.site.itemViews.forEach(function(view, i) {
|
||||
if (i < 10) {
|
||||
Ox.Event.bind('key_shift_' + (i + 1) % 10, function() {
|
||||
pandora.UI.set({itemView: view.id});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
pandora.clipboard.bindEvent(function(data, event) {
|
||||
if (Ox.contains(['add', 'copy', 'clear'], event)) {
|
||||
that.replaceMenu('itemMenu', getItemMenu());
|
||||
|
|
Loading…
Reference in a new issue