From: Corey Snyder Date: Tue, 3 May 2016 18:52:40 +0000 (-0400) Subject: changes to tooltip default behavior X-Git-Tag: v6.2.2-rc1~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8730%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git changes to tooltip default behavior --- diff --git a/js/foundation.tooltip.js b/js/foundation.tooltip.js index 1998979f0..02fbd5461 100644 --- a/js/foundation.tooltip.js +++ b/js/foundation.tooltip.js @@ -40,7 +40,7 @@ class Tooltip { this.template = this.options.template ? $(this.options.template) : this._buildTemplate(elemId); this.template.appendTo(document.body) - .html(this.options.tipText) + .text(this.options.tipText) .hide(); this.$element.attr({ @@ -248,28 +248,10 @@ class Tooltip { } }) .on('mouseleave.zf.tooltip', function(e) { - if (_this.options.tipHoverable) { - _this.timeout = setTimeout(function () { - clearTimeout(_this.timeout); - if ($template.is(":hover")) { - $template.on('mouseleave', function (e) { - if (!isFocus || !_this.isClick && _this.options.clickOpen) { - _this.hide(); - } - $template.off('mouseleave'); - }); - } else { - if (!isFocus || !_this.isClick && _this.options.clickOpen) { - _this.hide(); - } - } - }, 200); //min required to capture - } else { - clearTimeout(_this.timeout); - if (!isFocus || !_this.isClick && _this.options.clickOpen) { - _this.hide(); - } - } + clearTimeout(_this.timeout); + if (!isFocus || (_this.isClick && !_this.options.clickOpen)) { + _this.hide(); + } }); } @@ -449,13 +431,7 @@ Tooltip.defaults = { * @option * @example 12 */ - hOffset: 12, - /** - * Should the tip remain open if hover - * @option - * @example false - */ - tipHoverable: false + hOffset: 12 }; /** @@ -465,4 +441,4 @@ Tooltip.defaults = { // Window exports Foundation.plugin(Tooltip, 'Tooltip'); -}(jQuery); +}(jQuery); \ No newline at end of file