fix home screen bugs

This commit is contained in:
rolux 2012-02-19 14:55:08 +00:00
parent 1a92d2a315
commit 7398993bc1

View file

@ -375,11 +375,14 @@ pandora.ui.home = function() {
.hide() .hide()
.bindEvent({ .bindEvent({
mousedown: function() { mousedown: function() {
counter = 0;
scrollToPosition(position - 1, true); scrollToPosition(position - 1, true);
}, },
mouserepeat: function() { mouserepeat: function() {
if (counter++ % 10 == 0) {
scrollToPosition(position - 1, false); scrollToPosition(position - 1, false);
} }
}
}) })
.appendTo($listsBox); .appendTo($listsBox);
$nextButton = Ox.Button({ $nextButton = Ox.Button({
@ -400,7 +403,9 @@ pandora.ui.home = function() {
scrollToPosition(position + 1, true); scrollToPosition(position + 1, true);
}, },
mouserepeat: function() { mouserepeat: function() {
Ox.print('---------------------------')
if (counter++ % 10 == 0) { if (counter++ % 10 == 0) {
Ox.print('YES')
scrollToPosition(position + 1, false); scrollToPosition(position + 1, false);
} }
} }
@ -423,9 +428,10 @@ pandora.ui.home = function() {
}, },
mousewheel: function(e, delta, deltaX, deltaY) { mousewheel: function(e, delta, deltaX, deltaY) {
Ox.print('mwd', deltaX) Ox.print('mwd', deltaX)
scrollToPosition(position + Math.round(deltaX), true); scrollToPosition(position + Math.round(deltaX * 2), true);
} }
}); });
}
self.keydown = function(e) { self.keydown = function(e) {
var focused = Ox.Focus.focused(), var focused = Ox.Focus.focused(),
key = Ox.KEYS[e.keyCode]; key = Ox.KEYS[e.keyCode];
@ -445,7 +451,6 @@ pandora.ui.home = function() {
} }
}; };
Ox.$document.bind({keydown: self.keydown}); Ox.$document.bind({keydown: self.keydown});
}
lists.forEach(function(list, i) { lists.forEach(function(list, i) {
$listBox[i] = $('<div>') $listBox[i] = $('<div>')
.css({ .css({