diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js index fe46a302..f3fb853e 100644 --- a/static/js/pandora/menu.js +++ b/static/js/pandora/menu.js @@ -302,27 +302,27 @@ pandora.ui.mainMenu = function() { } }, key_control_comma: function() { - if (pandora.hasNoDialogOrScreen()) { + if (!pandora.hasDialogOrScreen()) { pandora.URL.push('/preferences'); } }, key_control_f: function() { - if (pandora.hasNoDialogOrScreen()) { + if (!pandora.hasDialogOrScreen()) { pandora.$ui.findInput.focusInput(true); } }, key_control_shift_w: function() { - if (pandora.hasNoDialogOrScreen() || (ui.item || ui._list)) { + if (!pandora.hasDialogOrScreen() || (ui.item || ui._list)) { pandora.UI.set({find: {conditions: [], operator: '&'}}); } }, key_control_slash: function() { - if (pandora.hasNoDialogOrScreen()) { + if (!pandora.hasDialogOrScreen()) { pandora.URL.push('/help'); } }, key_control_w: function() { - if (pandora.hasNoDialogOrScreen()) { + if (!pandora.hasDialogOrScreen()) { if (ui.item) { pandora.UI.set({item: ''}); } else if (ui._list) { diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index dc07ed1a..d44273ad 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -719,11 +719,16 @@ pandora.getVideoPartsAndPoints = function(durations, points) { return ret; }; -pandora.hasNoDialogOrScreen = function() { - return $('.OxDialog:visible').length == 0 - && $('.OxFullscreen').length == 0 - && $('.OxScreen').length == 0; -} +pandora.hasDialogOrScreen = function() { + return $('.OxDialog:visible').length + || $('.OxFullscreen').length + || $('.OxScreen').length; +}; + +pandora.hasFocusedInput = function() { + var focused = Ox.Focus.focused(); + return focused && Ox.UI.elements[focused].is('.OxInput'); +}; pandora.isClipView = function(view, item) { if (arguments.length == 0) { @@ -932,8 +937,9 @@ pandora.selectList = function() { ); pandora.$ui.folderList[folder] .options({selected: [pandora.user.ui._list]}); - // Don't steal focus from home screen - $('.OxScreen').length == 0 && pandora.$ui.folderList[folder].gainFocus(); + if (!pandora.hasDialogOrScreen() && !pandora.hasFocusedInput()) { + pandora.$ui.folderList[folder].gainFocus(); + } } }); }