fixes for resizebars

This commit is contained in:
rolux 2010-07-15 21:04:47 +02:00
parent ea8f08e884
commit 624c1cd105

View file

@ -1240,6 +1240,8 @@ requires
$.extend(self, {
clientXY: self.options.orientation == "horizontal" ? "clientY" : "clientX",
dimensions: oxui.getDimensions(self.options.orientation), // fixme: should orientation be the opposite orientation here?
edges: oxui.getEdges(self.options.orientation),
ids: $.map(self.options.elements, function(v, i) {
return v.options("id");
}),
@ -1258,11 +1260,11 @@ requires
return false;
}
});
that.css("left", self.options.size + "px");
self.options.elements[0].css("width", self.options.size + "px");
self.options.elements[1].css("left", (self.options.size + 1) + "px");
that.css(self.edges[2], self.options.size + "px");
self.options.elements[0].css(self.dimensions[1], self.options.size + "px");
self.options.elements[1].css(self.edges[2], (self.options.size + 1) + "px");
Ox.Event.trigger("resize_" + self.ids[0], self.options.size);
Ox.Event.trigger("resize_" + self.ids[1], self.options.elements[1].width());
Ox.Event.trigger("resize_" + self.ids[1], self.options.elements[1][self.dimensions[1]]());
}
function dragStart(e) {
@ -1282,10 +1284,11 @@ requires
Ox.print("toggle");
var size = self.options.collapsed ? 0 : -self.options.size,
animate = {};
Ox.print("s.o.e", self.options.edge);
animate[self.options.edge] = size;
self.options.parent.animate(animate, 200, function() {
var i = (self.options.edge == "left" || self.options.edge == "top") ? 1 : 0;
Ox.Event.trigger("resize_" + self.ids[i], self.options.elements[i].width());
Ox.Event.trigger("resize_" + self.ids[i], self.options.elements[i][self.dimensions[1]]());
self.options.collapsed = !self.options.collapsed;
});
}
@ -4641,7 +4644,8 @@ requires
Ox.print("v.size", v.size)
$resizebar = new Ox.Resizebar({
collapsible: v.collapsible,
edge: i == 0 ? "left" : "right",
edge: self.options.orientation == "horizontal" ?
(i == 0 ? "left" : "right") : (i == 0 ? "top" : "bottom"),
elements: i < 2 ?
[that.$elements[0], that.$elements[1]] :
[that.$elements[1], that.$elements[2]],