From 43495de239dd9e38f7ce1e1c3c32e06a1df0da24 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 23 Apr 2012 08:29:37 +0000 Subject: [PATCH] when expanding or collapsing part of a split panel, do not immediately switch the resizebar's tooltip --- source/Ox.UI/js/Bar/Ox.Resizebar.js | 4 +++- source/Ox.UI/js/Window/Ox.Tooltip.js | 13 +++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Bar/Ox.Resizebar.js b/source/Ox.UI/js/Bar/Ox.Resizebar.js index 107a4c38..c1a35860 100644 --- a/source/Ox.UI/js/Bar/Ox.Resizebar.js +++ b/source/Ox.UI/js/Bar/Ox.Resizebar.js @@ -158,7 +158,9 @@ Ox.Resizebar = function(options, self) { ); self.options.collapsed = !self.options.collapsed; that.css({cursor: getCursor()}); - self.$tooltip && self.$tooltip.options({title: getTitle()}); + self.$tooltip && self.$tooltip.hide(function() { + self.$tooltip.options({title: getTitle()}); + }); } } diff --git a/source/Ox.UI/js/Window/Ox.Tooltip.js b/source/Ox.UI/js/Window/Ox.Tooltip.js index b84f03d6..f5ae5831 100644 --- a/source/Ox.UI/js/Window/Ox.Tooltip.js +++ b/source/Ox.UI/js/Window/Ox.Tooltip.js @@ -35,12 +35,14 @@ Ox.Tooltip = function(options, self) { }; that.hide = function() { + var last = Ox.last(arguments); if (self.options.title) { if (self.options.animate) { that.animate({ opacity: 0 }, 250, function() { that.detach(); + Ox.isFunction(last) && last(); }); } else { that.detach(); @@ -52,12 +54,13 @@ Ox.Tooltip = function(options, self) { // can pass event instead of x/y // fixme: use this in widgets that.show = function(x, y) { - var left, top, width, height; + var last = Ox.last(arguments), + left, top, width, height; if (self.options.title) { - if (arguments.length == 1) { + if (Ox.isObject(arguments[0])) { self.x = arguments[0].clientX; self.y = arguments[0].clientY; - } else if (arguments.length == 2) { + } else { self.x = x; self.y = y } @@ -77,7 +80,9 @@ Ox.Tooltip = function(options, self) { }); self.options.animate && that.animate({ opacity: 1 - }, 250); + }, 250, function() { + Ox.isFunction(last) && last(); + }); } return that; };