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; };