temporary fix for parseKeyboard bug
This commit is contained in:
parent
9eb96ea54c
commit
4363c8dac1
3 changed files with 198 additions and 136 deletions
|
|
@ -182,6 +182,28 @@ Ox.filter = function(arr, fn) {
|
|||
return ret;
|
||||
};
|
||||
|
||||
Ox.getObjectById = function(arr, id) {
|
||||
var ret = null;
|
||||
Ox.each(arr, function(i, v) {
|
||||
if (v.id == id) {
|
||||
ret = v;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
Ox.getPositionById = function(arr, id) {
|
||||
var ret = -1;
|
||||
Ox.each(arr, function(i, v) {
|
||||
if (v.id == id) {
|
||||
ret = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
Ox.keys = function(obj) {
|
||||
/*
|
||||
>>> Ox.keys({"a": 1, "b": 2, "c": 3})
|
||||
|
|
@ -321,7 +343,7 @@ Ox.shuffle = function(arr) {
|
|||
|
||||
Ox.some = function(obj, fn) {
|
||||
/*
|
||||
Ox.some() forks for arrays, objects and strings, unlike [].some()
|
||||
Ox.some() works for arrays, objects and strings, unlike [].some()
|
||||
>>> Ox.some([2, 1, 0], function(i, v) { return i == v; })
|
||||
true
|
||||
>>> Ox.some({a: 1, b: 2, c: 3}, function(v) { return v == 1; })
|
||||
|
|
|
|||
|
|
@ -212,6 +212,10 @@ requires
|
|||
}
|
||||
return {
|
||||
bind: function(id, event, callback) {
|
||||
if (arguments.length == 2) {
|
||||
callback = event;
|
||||
event = id;
|
||||
}
|
||||
if (isKeyboardEvent(event)) {
|
||||
keyboardEvents[id] = keyboardEvents[id] || {};
|
||||
keyboardEvents[id][event] = callback;
|
||||
|
|
@ -2849,7 +2853,7 @@ requires
|
|||
self.$items[pos].appendTo(self.$pages[page]);
|
||||
});
|
||||
if (self.options.type == "text" && page == 0) {
|
||||
var height = that.height(),
|
||||
var height = that.height() - (that.width() < that.$content.width() ? oxui.scrollbarSize : 0),
|
||||
visibleItems = Math.ceil(height / self.options.itemHeight);
|
||||
if (result.data.items.length < visibleItems) {
|
||||
self.$pages[page].height(height).css({
|
||||
|
|
@ -4267,6 +4271,7 @@ requires
|
|||
);
|
||||
|
||||
function parseKeyboard(str) {
|
||||
if (Ox.isObject(str)) return str; // fixme: this should not happen
|
||||
var modifiers = str.split(" "),
|
||||
key = modifiers.pop();
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue