From 8431c1cad02a7ee3ba9293012c3da925ef1d6ab4 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Mon, 3 Oct 2022 16:25:31 +0300 Subject: [PATCH] tests(popover): fixing popover tests --- src/js/modules/infragistics.ui.popover.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/js/modules/infragistics.ui.popover.js b/src/js/modules/infragistics.ui.popover.js index 997477075..6ade2de17 100644 --- a/src/js/modules/infragistics.ui.popover.js +++ b/src/js/modules/infragistics.ui.popover.js @@ -834,20 +834,20 @@ case "click": showEvt = "click.popover"; hideEvt = "blur.popover"; - targetShowEvt = self._targetClick; - targetHideEvt = self._targetBlur; + targetShowEvt = this._targetClick.bind(this); + targetHideEvt = this._targetBlur.bind(this); break; case "focus": showEvt = "focusin.popover"; hideEvt = "focusout.popover"; - targetShowEvt = self._focusin; - targetHideEvt = self._focusout; + targetShowEvt = this._focusin.bind(this); + targetHideEvt = this._focusout.bind(this); break; case "mouseenter": showEvt = "mouseenter.popover"; hideEvt = "mouseleave.popover"; - targetShowEvt = self._targetMouseMove; - targetHideEvt = self._targetMouseLeave; + targetShowEvt = this._targetMouseMove.bind(this); + targetHideEvt = this._targetMouseLeave.bind(this); break; default: @@ -865,10 +865,10 @@ (typeof t[ 0 ] === "object") && (t[ 0 ].nodeType === 1) && ( typeof t[ 0 ].style === "object" ) && ( typeof t[ 0 ].ownerDocument === "object" ) ) ) { - $(t).unbind(showEvt).bind(showEvt, targetShowEvt.bind(this)); - $(t).unbind(hideEvt).bind(hideEvt, targetHideEvt.bind(this)); + $(t).unbind(showEvt).bind(showEvt, targetShowEvt); + $(t).unbind(hideEvt).bind(hideEvt, targetHideEvt); } else if (this.options.selectors && showEvt) { - this.element.find(self.options.selectors).addBack().each(function () { + this.element.find(this.options.selectors).addBack().each(function () { var target = $(this)[ 0 ]; /* verify that no popover should be shown for the original div */ if (target === self.element[ 0 ]) { @@ -881,7 +881,7 @@ }, _detachEventsFromTarget: function () { /* T.G Sep 23th, 2013 Bug #152943 destroy of igPopover */ - var t = this._target, self = this; + var t = this._target; /* K.D. July 18th, 2012 Bug #117374 The HTMLElement object is natively not defined in IE <= 8 Abstain from referring to "natively" defined objects as we're not sure in what cases they would actually be undefined. Add to check if is jQuery object*/ @@ -894,7 +894,7 @@ ( typeof t[ 0 ].ownerDocument === "object" ) ) ) { $(t).unbind(".popover"); } else if (this.options.selectors) { - this.element.find(self.options.selectors).addBack().each(function () { + this.element.find(this.options.selectors).addBack().each(function () { var target = $(this); $(target).unbind(".popover"); });