use Ox.Focus.focusedElementIsInput; Ox.UI -> Ox

This commit is contained in:
rolux 2014-09-25 18:53:35 +02:00 committed by j
parent b1353bad96
commit f064cfd114
4 changed files with 12 additions and 20 deletions

View file

@ -273,7 +273,7 @@ pandora.ui.home = function() {
} }
that.fadeInScreen = 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() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() {
$findInput.focusInput(true); $findInput.focusInput(true);
}); });
@ -302,7 +302,7 @@ pandora.ui.home = function() {
that.showScreen = function(callback) { that.showScreen = function(callback) {
var $elements = that.find(':not(.logo)'), count = 0; var $elements = that.find(':not(.logo)'), count = 0;
$logo.css({width: '320px'}); $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}); that.find('.logo').css({opacity: 1});
$elements.animate({opacity: 1}, 500, function() { $elements.animate({opacity: 1}, 500, function() {
if (callback && ++count == $elements.length) { if (callback && ++count == $elements.length) {

View file

@ -563,12 +563,8 @@ pandora.ui.home = function() {
.appendTo($featureBox[i]); .appendTo($featureBox[i]);
}); });
self.keydown = function(e) { self.keydown = function(e) {
var focused = Ox.Focus.focused(), var key = Ox.KEYS[e.keyCode];
key = Ox.KEYS[e.keyCode]; if (!Ox.Focus.focusedElementIsInput()) {
if (
focused === null
|| !Ox.elements[focused].hasClass('OxInput')
) {
if (key == 'left' && selected > 0) { if (key == 'left' && selected > 0) {
selectItem(selected - 1); selectItem(selected - 1);
} else if (key == 'up' && selected > 0) { } else if (key == 'up' && selected > 0) {
@ -697,7 +693,7 @@ pandora.ui.home = function() {
} }
that.fadeInScreen = 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() { that.find('*').animate({opacity: 1}, 250, function() {
$findInput.focusInput(true); $findInput.focusInput(true);
showFeatures(); showFeatures();
@ -719,7 +715,7 @@ pandora.ui.home = function() {
that.showScreen = function(callback) { that.showScreen = function(callback) {
var $elements = that.find('*'), count = 0; var $elements = that.find('*'), count = 0;
$box.css({top: window.innerHeight / 2 - 40 + 'px'}); $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); $findInput.focusInput(true);
$box.animate({top: '80px'}, 500, function() { $box.animate({top: '80px'}, 500, function() {
$elements.animate({opacity: 1}, 250, function() { $elements.animate({opacity: 1}, 250, function() {

View file

@ -256,7 +256,7 @@ pandora.ui.home = function() {
} }
that.fadeInScreen = 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() { that.find(':not(#logo)').animate({opacity: 1}, 250, function() {
$findInput.focusInput(true); $findInput.focusInput(true);
}); });
@ -285,7 +285,7 @@ pandora.ui.home = function() {
that.showScreen = function(callback) { that.showScreen = function(callback) {
var $elements = that.find(':not(.logo)'), count = 0; var $elements = that.find(':not(.logo)'), count = 0;
$logo.css({width: '320px'}); $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}); that.find(':not(#logo)').css({opacity: 1});
$elements.animate({opacity: 1}, 500, function() { $elements.animate({opacity: 1}, 500, function() {
if (callback && ++count == $elements.length) { if (callback && ++count == $elements.length) {

View file

@ -535,12 +535,8 @@ pandora.ui.home = function() {
.appendTo($featureBox[i]); .appendTo($featureBox[i]);
}); });
self.keydown = function(e) { self.keydown = function(e) {
var focused = Ox.Focus.focused(), var key = Ox.KEYS[e.keyCode];
key = Ox.KEYS[e.keyCode]; if (!Ox.Focus.focusedElementIsInput()) {
if (
focused === null
|| !Ox.elements[focused].hasClass('OxInput')
) {
if (key == 'left' && selected > 0) { if (key == 'left' && selected > 0) {
selectItem(selected - 1); selectItem(selected - 1);
} else if (key == 'up' && selected > 0) { } else if (key == 'up' && selected > 0) {
@ -669,7 +665,7 @@ pandora.ui.home = function() {
} }
that.fadeInScreen = 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() { that.find('*').animate({opacity: 1}, 250, function() {
$findInput.focusInput(true); $findInput.focusInput(true);
showFeatures(); showFeatures();
@ -691,7 +687,7 @@ pandora.ui.home = function() {
that.showScreen = function(callback) { that.showScreen = function(callback) {
var $elements = that.find('*'), count = 0; var $elements = that.find('*'), count = 0;
$box.css({top: window.innerHeight / 2 - 80 + 'px'}); $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); $findInput.focusInput(true);
$box.animate({top: '80px'}, 500, function() { $box.animate({top: '80px'}, 500, function() {
$elements.animate({opacity: 1}, 250, function() { $elements.animate({opacity: 1}, 250, function() {