some bugfixes

This commit is contained in:
rolux 2010-12-27 05:01:24 +00:00
parent 85f85f7250
commit 7439ca7d07

View file

@ -432,7 +432,7 @@ requires
} }
}, },
focused: function() { focused: function() {
return stack[stack.length - 1]; return stack.length ? stack[stack.length - 1] : null;
} }
}; };
}(); }();
@ -597,7 +597,8 @@ requires
} }
}); });
function keypress(event) { function keypress(event) {
var key, var focused = Ox.Focus.focused(),
key,
keys = [], keys = [],
//ret = true, //ret = true,
time; time;
@ -620,7 +621,7 @@ requires
buffer += key == 'SPACE' ? ' ' : key; buffer += key == 'SPACE' ? ' ' : key;
bufferTime = time; bufferTime = time;
} }
$elements[Ox.Focus.focused()].trigger('ox_key_' + key); focused && $elements[focused].trigger('ox_key_' + key);
//return false; //return false;
/* /*
$.each(stack, function(i, v) { $.each(stack, function(i, v) {
@ -1061,7 +1062,7 @@ requires
return ret; return ret;
}; };
that.remove = function() { that.remove = function() { // fixme: clashes with jquery, should be removeElement
//self.options && Ox.Event.unbind(self.options.id); // there are optionless elements, like the dialog layer //self.options && Ox.Event.unbind(self.options.id); // there are optionless elements, like the dialog layer
//that.loseFocus(); //that.loseFocus();
that.$element.remove(); that.$element.remove();
@ -1453,7 +1454,7 @@ requires
clientXY: self.options.orientation == 'horizontal' ? 'clientY' : 'clientX', clientXY: self.options.orientation == 'horizontal' ? 'clientY' : 'clientX',
dimensions: oxui.getDimensions(self.options.orientation), // fixme: should orientation be the opposite orientation here? dimensions: oxui.getDimensions(self.options.orientation), // fixme: should orientation be the opposite orientation here?
edges: oxui.getEdges(self.options.orientation), edges: oxui.getEdges(self.options.orientation),
ids: $.map(self.options.elements, function(element) { ids: $.map(self.options.elements, function(element) { // fixme: needed?
return element.options('id'); return element.options('id');
}), }),
leftOrTop: self.options.edge == 'left' || self.options.edge == 'top', leftOrTop: self.options.edge == 'left' || self.options.edge == 'top',
@ -1478,17 +1479,21 @@ requires
if (self.options.size != size) { if (self.options.size != size) {
that.css(self.edges[self.leftOrTop ? 2 : 3], self.options.size + 'px'); that.css(self.edges[self.leftOrTop ? 2 : 3], self.options.size + 'px');
if (self.leftOrTop) { if (self.leftOrTop) {
self.options.elements[0].css(self.dimensions[1], self.options.size + 'px'); self.options.elements[0]
self.options.elements[1].css(self.edges[2], (self.options.size + 1) + 'px'); .css(self.dimensions[1], self.options.size + 'px')
Ox.Event.trigger(self.ids[0], 'resize', self.options.size); .triggerEvent('resize', self.options.size);
Ox.Event.trigger(self.ids[1], 'resize', self.options.elements[1][self.dimensions[1]]()); self.options.elements[1]
.css(self.edges[2], (self.options.size + 1) + 'px')
.triggerEvent('resize', self.options.elements[1][self.dimensions[1]]());
self.options.parent.updateSize(self.ids[0], self.options.size); self.options.parent.updateSize(self.ids[0], self.options.size);
} else { } else {
self.options.elements[1].css(self.dimensions[1], self.options.size + 'px'); self.options.elements[0]
self.options.elements[0].css(self.edges[3], (self.options.size + 1) + 'px'); .css(self.edges[3], (self.options.size + 1) + 'px')
Ox.Event.trigger(self.ids[0], 'resize', self.options.elements[0][self.dimensions[1]]()); .triggerEvent('resize', self.options.elements[0][self.dimensions[1]]());
Ox.Event.trigger(self.ids[1], 'resize', self.options.size); self.options.elements[1]
self.options.parent.updateSize(self.ids[1], self.options.size); .css(self.dimensions[1], self.options.size + 'px')
.triggerEvent('resize', self.options.size);
self.options.parent.updateSize(self.ids[1], self.options.size); // fixme: listen to event instead?
} }
} }
} }
@ -4324,6 +4329,8 @@ requires
hide: hideMenu hide: hideMenu
}); });
self.options.type == 'image' && self.$menu.addClass('OxRight');
function clickMenu(event, data) { function clickMenu(event, data) {
Ox.print('%% clickMenu') Ox.print('%% clickMenu')
} }