diff options
author | Mark Otto <markdotto@gmail.com> | 2016-11-01 07:14:23 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2016-11-01 07:14:23 +0300 |
commit | 76d53404b552c9870c3d3bf0e1f8976bb3136f13 (patch) | |
tree | fd1f0974c01b35b5bf5593d8a14dbf2b1fc91209 /js/dist/tooltip.js | |
parent | f734814f6ba6c86673f771b073425ca6f7f72693 (diff) |
grunt
Diffstat (limited to 'js/dist/tooltip.js')
-rw-r--r-- | js/dist/tooltip.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index 25011aff3d..80a9815177 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -204,6 +204,9 @@ var Tooltip = function ($) { Tooltip.prototype.show = function show() { var _this = this; + if ($(this.element).css('display') === 'none') { + throw new Error('Please use show on visible elements'); + } var showEvent = $.Event(this.constructor.Event.SHOW); if (this.isWithContent() && this._isEnabled) { @@ -373,12 +376,18 @@ var Tooltip = function ($) { triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3)); + $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) { + return _this3.toggle(event); + }); } else if (trigger !== Trigger.MANUAL) { var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; - $(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3)); + $(_this3.element).on(eventIn, _this3.config.selector, function (event) { + return _this3._enter(event); + }).on(eventOut, _this3.config.selector, function (event) { + return _this3._leave(event); + }); } }); |