From 624c1cd105bb64724108158ac42d5131ab66e9ed Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 15 Jul 2010 21:04:47 +0200 Subject: [PATCH] fixes for resizebars --- build/js/ox.ui.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index ab643e70..d8d602c5 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -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]],