forked from 0x2620/pandora
when the browser has focus, make pressing space shift the focus to the player/editor/timeline and trigger play (fixes #526)
This commit is contained in:
parent
1dfcd9698d
commit
5b0a8ea03e
1 changed files with 18 additions and 0 deletions
|
@ -122,6 +122,12 @@ pandora.ui.browser = function() {
|
||||||
open: function() {
|
open: function() {
|
||||||
that.scrollToSelection();
|
that.scrollToSelection();
|
||||||
},
|
},
|
||||||
|
openpreview: function() {
|
||||||
|
var itemView = pandora.user.ui.itemView;
|
||||||
|
if (['player', 'editor', 'timeline'].indexOf(itemView) > -1) {
|
||||||
|
pandora.$ui[itemView].gainFocus().triggerEvent('key_space');
|
||||||
|
}
|
||||||
|
},
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
data.ids.length && pandora.UI.set({
|
data.ids.length && pandora.UI.set({
|
||||||
'item': data.ids[0]
|
'item': data.ids[0]
|
||||||
|
@ -157,6 +163,18 @@ pandora.ui.browser = function() {
|
||||||
pandora_showsiteposters: function() {
|
pandora_showsiteposters: function() {
|
||||||
pandora.user.ui.icons == 'posters' && that.reloadList(true);
|
pandora.user.ui.icons == 'posters' && that.reloadList(true);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.bindEventOnce({
|
||||||
|
load: function() {
|
||||||
|
// gain focus if we're on page load or if we've just switched
|
||||||
|
// to an item and the not-yet-garbage-collected list still has
|
||||||
|
// focus
|
||||||
|
if (Ox.Focus.focused() === null || (
|
||||||
|
pandora.$ui.list && pandora.$ui.list.hasFocus()
|
||||||
|
)) {
|
||||||
|
that.gainFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
that.css({overflowY: 'hidden'}); // this fixes a bug in firefox
|
that.css({overflowY: 'hidden'}); // this fixes a bug in firefox
|
||||||
pandora.enableDragAndDrop(that, false);
|
pandora.enableDragAndDrop(that, false);
|
||||||
|
|
Loading…
Reference in a new issue