Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*): removing usage of deprecated $.proxy #2208

Merged
merged 4 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/js/modules/infragistics.datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -4651,7 +4651,7 @@
var o, s;
/* trigger the call */
if (this.settings.responseDataType === "jsonp") {
/* $.getJSON(options.url, options.data, $.proxy(this._jsonpFilter, this)); */
/* $.getJSON(options.url, options.data, this._jsonpFilter.bind(this)); */
/* M.H. 29 Aug 2013 Fix for bug #150723: When dataSource is remote and it is used JSONP
then in Chrome and Firefox it is thrown exception and grid is not loaded */
/* M.H. 19 Sep 2013 Fix for bug #151600: [Templating] Row Template with Images doesn't load */
Expand All @@ -4660,8 +4660,8 @@
type: "GET",
url: options.url,
data: options.data,
success: $.proxy(this._jsonpFilter, this),
error: $.proxy(this._errorCallback, this)
success: this._jsonpFilter.bind(this),
error: this._errorCallback.bind(this)
};
/* M.H. 19 Sep 2013 Fix for bug #151600: [Templating] Row Template with Images doesn't load */
s = this.settings;
Expand Down Expand Up @@ -8612,9 +8612,9 @@
_createHttpHandlers: function () {
// Adding only success related handlers
// handle errors accurately
this._okHandler = $.proxy(this._responseOk, this);
this._createdHandler = $.proxy(this._responseCreated, this);
this._noContentHandler = $.proxy(this._responseNoContent, this);
this._okHandler = this._responseOk.bind(this);
this._createdHandler = this._responseCreated.bind(this);
this._noContentHandler = this._responseNoContent.bind(this);
this._httpHandlers = {
"POST": {
"201": this._createdHandler
Expand Down Expand Up @@ -9469,7 +9469,7 @@
/* necessary to push all of the layout children props
this._rootopts.schema.fields.push({name: this.settings.defaultChildrenDataProperty});
depending on the value of initialDataBindDepth, we need to encode the URL so that load on demand works */
this._rootopts.urlParamsEncoded = $.proxy(this._encodeHierarchicalUrlParams, this);
this._rootopts.urlParamsEncoded = this._encodeHierarchicalUrlParams.bind(this);
/* K.D. April 22nd, 2014 Bug #169669 instanceof does not work in an iframe. */
if (this._rootopts.dataSource && typeof this._rootopts.dataSource._xmlToArray === "function" &&
typeof this._rootopts.dataSource._encodePkParams === "function") {
Expand Down Expand Up @@ -9842,7 +9842,7 @@
},
_applySchema: function (forceApply) {
var s = this.schema();
s.transform = $.proxy(this._transformSchema, this);
s.transform = this._transformSchema.bind(this);
this._checkGeneratedSchema();
this._super(forceApply);
this.generateFlatDataView();
Expand Down Expand Up @@ -9881,8 +9881,8 @@
}
/* overwrite default schema transform function - for now there is no igTreeHierarchicalSchema */
if (!this._transformCallback) {
this._transformCallback = $.proxy(s.transform, s);
s.transform = $.proxy(this._transformSchema, this);
this._transformCallback = s.transform.bind(s);
s.transform = this._transformSchema.bind(this);
}
}
this._flatDataView = [];
Expand Down Expand Up @@ -10744,7 +10744,7 @@
func = window[ func ];
}
if ($.type(func) !== "function") {
func = $.proxy(this._requestData, this);
func = this._requestData.bind(this);
}
func(record, expand, callbackArgs);
return;
Expand Down
9 changes: 3 additions & 6 deletions src/js/modules/infragistics.ui.colorpickersplitbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@
},
_attachEvents: function () {
$.ui.igSplitButton.prototype._attachEvents.call(this);
this._options.itemsList.on("igcolorpickercolorselected",
$.proxy(this._onColorSelect, this));
this._options.defaultButton.on("igtoolbarbuttonclick",
$.proxy(this._onDefaultButtonClick, this));
this._options.itemsList.parent().parent().on("mousedown",
$.proxy(this._preventCollapsing, this));
this._options.itemsList.on("igcolorpickercolorselected", this._onColorSelect.bind(this));
this._options.defaultButton.on("igtoolbarbuttonclick", this._onDefaultButtonClick.bind(this));
this._options.itemsList.parent().parent().on("mousedown", this._preventCollapsing.bind(this));
},
_onItemClick: function () {
return false;
Expand Down
31 changes: 15 additions & 16 deletions src/js/modules/infragistics.ui.combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1640,23 +1640,23 @@

// Event handlers
this._handlers = {
windowResize: $.proxy(this._windowResize, this),
documentMouseUp: $.proxy(this._documentMouseUp, this),
inputFocus: $.proxy(this._inputFocus, this),
inputBlur: $.proxy(this._inputBlur, this),
inputClick: $.proxy(this._inputClick, this),
inputKeyDown: $.proxy(this._inputKeyDown, this),
inputPaste: $.proxy(this._inputPaste, this),
inputKeyUp: $.proxy(this._inputKeyUp, this),
inputKeyPress: $.proxy(this._inputKeyPress, this),
inputMouseDown: $.proxy(this._inputMouseDown, this),
windowResize: this._windowResize.bind(this),
documentMouseUp: this._documentMouseUp.bind(this),
inputFocus: this._inputFocus.bind(this),
inputBlur: this._inputBlur.bind(this),
inputClick: this._inputClick.bind(this),
inputKeyDown: this._inputKeyDown.bind(this),
inputPaste: this._inputPaste.bind(this),
inputKeyUp: this._inputKeyUp.bind(this),
inputKeyPress: this._inputKeyPress.bind(this),
inputMouseDown: this._inputMouseDown.bind(this),

// P.P 02-Mar-2016 #212238: Incorrect confirmation of Japanese symbols using IME
inputCompositionUpdate: $.proxy(this._inputCompositionUpdate, this),
inputCompositionUpdate: this._inputCompositionUpdate.bind(this),

// P.P 26-Feb-2016 #212236: Incorrect input of Japanese symbols using IME
inputCompositionEnd: $.proxy(this._inputCompositionEnd, this),
inputInput: $.proxy(this._inputInputHandler, this)
inputCompositionEnd: this._inputCompositionEnd.bind(this),
inputInput: this._inputInputHandler.bind(this)
};

this._analyzeOptions();
Expand Down Expand Up @@ -5224,8 +5224,7 @@
options.dataSource.settings.dataSource = url;
options.dataSource.settings.type = "remoteUrl";
options.dataSource._runtimeType = options.dataSource.analyzeDataSource();
options.dataSource.settings.urlParamsEncoded =
$.proxy(function (data, params) {
options.dataSource.settings.urlParamsEncoded = function (data, params) {
params = params ? params.filteringParams : null;

// set flag used by Mvc remote filtering
Expand All @@ -5241,7 +5240,7 @@
params.compact = "1";
}
}
}, this);
}.bind(this);
}

// S.T. Feb 27th, 2015 Bug #189554: Support for loadOnDemand coming from Mvc
Expand Down
8 changes: 4 additions & 4 deletions src/js/modules/infragistics.ui.editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3511,10 +3511,10 @@
try {
$(this._dropDownList).show("blind", { direction: direction },
this.options.dropDownAnimationDuration,
$.proxy(this._triggerDropDownOpened, this));
this._triggerDropDownOpened.bind(this));
} catch (ex) {
$(this._dropDownList).show(this.options.dropDownAnimationDuration,
$.proxy(this._triggerDropDownOpened, this));
this._triggerDropDownOpened.bind(this));
}
this._editorInput.attr("aria-expanded", true);
this._markDropDownHoverActiveItem();
Expand All @@ -3530,10 +3530,10 @@
try {
$(this._dropDownList).hide("blind", { direction: direction },
this.options.dropDownAnimationDuration,
$.proxy(this._triggerDropDownClosed, this));
this._triggerDropDownClosed.bind(this));
} catch (ex) {
$(this._dropDownList).hide(this.options.dropDownAnimationDuration,
$.proxy(this._triggerDropDownClosed, this));
this._triggerDropDownClosed.bind(this));
}
this._editorInput.attr("aria-expanded", false);
this._clearDropDownHoverActiveItem();
Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.htmleditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@
}
});

$(window).on("resize", $.proxy(this._resizeWorkspaceHandler, this));
$(window).on("resize", this._resizeWorkspaceHandler.bind(this));

},
_viewSource: function () {
Expand Down
30 changes: 15 additions & 15 deletions src/js/modules/infragistics.ui.popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
this._positions = [ "balanced", "start", "end" ];
this._visible = false;
this._useDocumentBoundary = false;
$( window ).on( "resize.popover", $.proxy( this._resizeHandler, this ) );
$( window ).on("resize.popover", this._resizeHandler.bind(this));
},
_createWidget: function (options, element) {
// initialization performance will be better if we don't try to normalize the defaults
Expand Down Expand Up @@ -639,7 +639,7 @@
if (this.options.headerTemplate.closeButton) {
var closeBtn = $("<div></div>")
.addClass(this.css.closeButtonClass)
.bind("click.popover", $.proxy(this._closeBtnClick, this))
.bind("click.popover", this._closeBtnClick.bind(this))
.appendTo(cnt);
if (this.id()) {
closeBtn.attr("id", this.id() + "_popover_closeBtn");
Expand Down Expand Up @@ -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:

Expand All @@ -865,23 +865,23 @@
(typeof t[ 0 ] === "object") && (t[ 0 ].nodeType === 1) &&
( typeof t[ 0 ].style === "object" ) &&
( typeof t[ 0 ].ownerDocument === "object" ) ) ) {
$(t).unbind(showEvt).bind(showEvt, $.proxy(targetShowEvt, this));
$(t).unbind(hideEvt).bind(hideEvt, $.proxy(targetHideEvt, 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 ]) {
return;
}
$(target).unbind(showEvt).bind(showEvt, $.proxy(targetShowEvt, self));
$(target).unbind(hideEvt).bind(hideEvt, $.proxy(targetHideEvt, self));
$(target).unbind(showEvt).bind(showEvt, targetShowEvt);
$(target).unbind(hideEvt).bind(hideEvt, targetHideEvt);
});
}
},
_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*/
Expand All @@ -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");
});
Expand Down
Loading