From f064cfd114e3d5d851bb78cc800d37dba205ab7b Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 25 Sep 2014 18:53:35 +0200 Subject: [PATCH] use Ox.Focus.focusedElementIsInput; Ox.UI -> Ox --- static/js/home.0xdb.js | 4 ++-- static/js/home.indiancinema.js | 12 ++++-------- static/js/home.js | 4 ++-- static/js/home.padma.js | 12 ++++-------- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/static/js/home.0xdb.js b/static/js/home.0xdb.js index 70d4fca1..ba01b8ad 100644 --- a/static/js/home.0xdb.js +++ b/static/js/home.0xdb.js @@ -273,7 +273,7 @@ pandora.ui.home = function() { } that.fadeInScreen = function() { - that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { + that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() { $findInput.focusInput(true); }); @@ -302,7 +302,7 @@ pandora.ui.home = function() { that.showScreen = function(callback) { var $elements = that.find(':not(.logo)'), count = 0; $logo.css({width: '320px'}); - that.css({opacity: 1}).appendTo(Ox.UI.$body); + that.css({opacity: 1}).appendTo(Ox.$body); that.find('.logo').css({opacity: 1}); $elements.animate({opacity: 1}, 500, function() { if (callback && ++count == $elements.length) { diff --git a/static/js/home.indiancinema.js b/static/js/home.indiancinema.js index 83479042..d0a0f74b 100644 --- a/static/js/home.indiancinema.js +++ b/static/js/home.indiancinema.js @@ -563,12 +563,8 @@ pandora.ui.home = function() { .appendTo($featureBox[i]); }); self.keydown = function(e) { - var focused = Ox.Focus.focused(), - key = Ox.KEYS[e.keyCode]; - if ( - focused === null - || !Ox.elements[focused].hasClass('OxInput') - ) { + var key = Ox.KEYS[e.keyCode]; + if (!Ox.Focus.focusedElementIsInput()) { if (key == 'left' && selected > 0) { selectItem(selected - 1); } else if (key == 'up' && selected > 0) { @@ -697,7 +693,7 @@ pandora.ui.home = function() { } that.fadeInScreen = function() { - that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { + that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find('*').animate({opacity: 1}, 250, function() { $findInput.focusInput(true); showFeatures(); @@ -719,7 +715,7 @@ pandora.ui.home = function() { that.showScreen = function(callback) { var $elements = that.find('*'), count = 0; $box.css({top: window.innerHeight / 2 - 40 + 'px'}); - that.css({opacity: 1}).appendTo(Ox.UI.$body); + that.css({opacity: 1}).appendTo(Ox.$body); $findInput.focusInput(true); $box.animate({top: '80px'}, 500, function() { $elements.animate({opacity: 1}, 250, function() { diff --git a/static/js/home.js b/static/js/home.js index 26e6c931..22d869d8 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -256,7 +256,7 @@ pandora.ui.home = function() { } that.fadeInScreen = function() { - that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { + that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() { $findInput.focusInput(true); }); @@ -285,7 +285,7 @@ pandora.ui.home = function() { that.showScreen = function(callback) { var $elements = that.find(':not(.logo)'), count = 0; $logo.css({width: '320px'}); - that.css({opacity: 1}).appendTo(Ox.UI.$body); + that.css({opacity: 1}).appendTo(Ox.$body); that.find(':not(#logo)').css({opacity: 1}); $elements.animate({opacity: 1}, 500, function() { if (callback && ++count == $elements.length) { diff --git a/static/js/home.padma.js b/static/js/home.padma.js index f97d28f1..c222b0f9 100644 --- a/static/js/home.padma.js +++ b/static/js/home.padma.js @@ -535,12 +535,8 @@ pandora.ui.home = function() { .appendTo($featureBox[i]); }); self.keydown = function(e) { - var focused = Ox.Focus.focused(), - key = Ox.KEYS[e.keyCode]; - if ( - focused === null - || !Ox.elements[focused].hasClass('OxInput') - ) { + var key = Ox.KEYS[e.keyCode]; + if (!Ox.Focus.focusedElementIsInput()) { if (key == 'left' && selected > 0) { selectItem(selected - 1); } else if (key == 'up' && selected > 0) { @@ -669,7 +665,7 @@ pandora.ui.home = function() { } that.fadeInScreen = function() { - that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500, function() { + that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find('*').animate({opacity: 1}, 250, function() { $findInput.focusInput(true); showFeatures(); @@ -691,7 +687,7 @@ pandora.ui.home = function() { that.showScreen = function(callback) { var $elements = that.find('*'), count = 0; $box.css({top: window.innerHeight / 2 - 80 + 'px'}); - that.css({opacity: 1}).appendTo(Ox.UI.$body); + that.css({opacity: 1}).appendTo(Ox.$body); $findInput.focusInput(true); $box.animate({top: '80px'}, 500, function() { $elements.animate({opacity: 1}, 250, function() {