fix bug with keyboard events

This commit is contained in:
rolux 2011-04-30 00:56:46 +02:00
parent 5f417fa152
commit 0211be527c
4 changed files with 15 additions and 14 deletions

View file

@ -125,7 +125,7 @@ Ox.load.UI = function(options, callback) {
}
function showWarning() {
Ox.print('showWarning')
//Ox.print('showWarning')
var counter = 0,
message = 'Browser not supported, use ' + browsers.map(function(browser, i) {
return browser.name + (
@ -203,17 +203,17 @@ Ox.load.UI = function(options, callback) {
if ($.browser.opera && Ox.endsWith(file, '.svg')) {
return;
}
Ox.print('load', file)
//Ox.print('load', file)
var dfd = new $.Deferred();
Ox.loadFile(Ox.PATH + file, function() {
dfd.resolve();
});
promises.push(dfd.promise());
});
Ox.print('promises.length', promises.length)
//Ox.print('promises.length', promises.length)
$.when.apply(null, promises)
.done(function() {
Ox.print('promises done')
//Ox.print('promises done')
$(function() {
if (options.showScreen && options.hideScreen) {
Ox.UI.hideLoadingScreen();
@ -273,7 +273,7 @@ Ox.load.UI = function(options, callback) {
+ filename.split('.').pop() + '/' + filename;
};
Ox.UI.hideLoadingScreen = function() {
Ox.print('hideLoadingScreen')
//Ox.print('hideLoadingScreen')
var $div = $('.OxLoadingScreen'),
error = $div.is('.OxError');
//$div.find('img').remove();

View file

@ -1,6 +1,5 @@
@import url("../themes/classic/css/classic.css");
@import url("../themes/modern/css/modern.css");
//@import url("Ox.UI.future.css");
/*
================================================================================

View file

@ -180,11 +180,13 @@
buffer += key == 'SPACE' ? ' ' : key;
bufferTime = time;
}
focused !== null && Ox.UI.elements[focused].triggerEvent('key_' + key);
// fixme: oxdb context browser suggests we should add left and right keys here
if (['down', 'space', 'up'].indexOf(key) > -1 && !Ox.UI.elements[focused].hasClass('OxInput')) {
// prevent chrome from scrolling
return false;
if (focused !== null) {
Ox.UI.elements[focused].triggerEvent('key_' + key);
// fixme: oxdb context browser suggests we should add left and right keys here
if (['down', 'space', 'up'].indexOf(key) > -1 && !Ox.UI.elements[focused].hasClass('OxInput')) {
// prevent chrome from scrolling
return false;
}
}
/*
stack.forEach(function(v) {

View file

@ -194,7 +194,7 @@ Ox.loadFile = (function() {
callback();
}
function addFileToCache() {
type == 'svg' && Ox.print('addToCache', file)
//type == 'svg' && Ox.print('addToCache', file)
if (type == 'css' || type == 'js') {
cache['file'] = true;
callback();
@ -650,10 +650,10 @@ Ox.makeObject = function(obj) {
undefined
*/
var ret = {};
if (obj.length == 1) {
if (Ox.isObject(obj[0])) {
// ({foo: 'bar'})
ret = obj[0];
} else if (obj.length == 2){
} else if (obj.length) {
// ('foo', 'bar')
ret[obj[0]] = obj[1]
}