From 79b708e269b5387882b7aacc23a1f559ec6df33e Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 11 Feb 2025 17:00:05 +0200 Subject: [PATCH 1/6] fix(*): removing the use of deprecated isFunction --- demos/combo/load-on-demand.html | 2 +- src/js/modules/infragistics.datasource.js | 14 +++++++------- src/js/modules/infragistics.ui.combo.js | 2 +- src/js/modules/infragistics.ui.htmleditor.js | 10 +++++----- src/js/modules/infragistics.ui.toolbar.js | 4 ++-- src/js/modules/infragistics.util.jquery.js | 4 ++-- .../rendering/htmleditor-test.js | 8 ++++---- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/demos/combo/load-on-demand.html b/demos/combo/load-on-demand.html index c977bc217..43fe6e1f9 100644 --- a/demos/combo/load-on-demand.html +++ b/demos/combo/load-on-demand.html @@ -54,7 +54,7 @@ // Helper function to put an item data token to the selected item table utilizing a jQuery template var selectedItemTemplate = '${propertyName}${propertyValue}'; function addItemValue(tableObject, item, itemProp) { - if (!($.isFunction(item[itemProp]))) { + if (typeof item[itemProp] !== "function") { $($.ig.tmpl(selectedItemTemplate, { "propertyName": itemProp, diff --git a/src/js/modules/infragistics.datasource.js b/src/js/modules/infragistics.datasource.js index a8c567523..0dbcf1f61 100644 --- a/src/js/modules/infragistics.datasource.js +++ b/src/js/modules/infragistics.datasource.js @@ -3993,7 +3993,7 @@ /* fire the data binding event */ args = { cancel: false }; - if ($.isFunction(p.dataBinding)) { + if (typeof p.dataBinding === "function") { noCancel = p.dataBinding(this, args); if (noCancel === undefined) { noCancel = true; @@ -4256,7 +4256,7 @@ }, _internalDataBound: function (callDatabound) { // M.H. 18 Aug 2014 Fix for bug #177147: The dataBound event is called before the JSON file is returned - if (callDatabound && $.isFunction(this.settings.dataBound)) { + if (callDatabound && typeof this.settings.dataBound === "function") { this.settings.dataBound(this); } }, @@ -4827,7 +4827,7 @@ "extraParams": extraParams, "pkParams": pkParams }; - if ($.isFunction(props.urlParamsEncoding)) { + if (typeof props.urlParamsEncoding === "function") { //args = props.urlParamsEncoding(this, params); noCancel = props.urlParamsEncoding(this, params); } @@ -4843,11 +4843,11 @@ this._encodePkParams(params); /* this should be implemented by any external features that are not direclly mapped as data source features such as group by summaries */ - if ($.isFunction(this.settings.encodeExtraParams)) { + if (typeof this.settings.encodeExtraParams === "function") { this.settings.encodeExtraParams(this, params); } - if ($.isFunction(props.urlParamsEncoded)) { + if (typeof props.urlParamsEncoded === "function") { props.urlParamsEncoded(this, params); } } @@ -5661,7 +5661,7 @@ direction = ""; } /* check if a custom conversion function is set */ - if ($.isFunction(s.customConvertFunc)) { + if (typeof s.customConvertFunc === "function") { convertFunc = s.customConvertFunc; } /*else { @@ -10967,7 +10967,7 @@ }; } /* check if a custom conversion function is set */ - if ($.isFunction(s.customConvertFunc)) { + if (typeof s.customConvertFunc === "function") { convertFunc = s.customConvertFunc; } /* else { diff --git a/src/js/modules/infragistics.ui.combo.js b/src/js/modules/infragistics.ui.combo.js index 38948e542..393db598a 100644 --- a/src/js/modules/infragistics.ui.combo.js +++ b/src/js/modules/infragistics.ui.combo.js @@ -5157,7 +5157,7 @@ // Analyze the schema only when the data source is array or function if (!schema && options.dataSource && ($.isArray(options.dataSource) || - $.isFunction(options.dataSource))) { + typeof options.dataSource === "function")) { // N.A. 5/18/2015 Bug #193129: Unwrap before extracting the schema from the first field element. schema = this._initSchema(this._unwrapData(options.dataSource)[ 0 ]); diff --git a/src/js/modules/infragistics.ui.htmleditor.js b/src/js/modules/infragistics.ui.htmleditor.js index 233f59361..966a272a4 100644 --- a/src/js/modules/infragistics.ui.htmleditor.js +++ b/src/js/modules/infragistics.ui.htmleditor.js @@ -3158,7 +3158,7 @@ // and select formatting option, the text on the whole row gets updated self._selectClosestTextNode(); - if ($.isFunction(callback)) { + if (typeof callback === "function") { callback.call(self); } }, @@ -3349,9 +3349,9 @@ } } - if ($.isFunction(customCommand) && browser === null) { + if (typeof customCommand === "function" && browser === null) { customCommand.call(this, name, args); - } else if ($.isFunction(customCommand) && isCommandSupported) { + } else if (typeof customCommand === "function" && isCommandSupported) { customCommand.apply(this, customCommandArgs); } else { this._document.execCommand(name, false, args); @@ -3670,8 +3670,8 @@ $.each(this._callbackMap, function (isTrueFunc, callback) { var isTrueRes = self[ isTrueFunc ](el); - if ($.isFunction(self[ isTrueFunc ]) && isTrueRes && - $.isFunction(self[ callback ])) { + if (typeof self[ isTrueFunc ] === "function" && isTrueRes && + typeof self[ callback ] === "function") { self[ callback ](el, isTrueRes); // Bug #184142 In IE justify left button is not active by default diff --git a/src/js/modules/infragistics.ui.toolbar.js b/src/js/modules/infragistics.ui.toolbar.js index 487d9e0ad..7cf8b9056 100644 --- a/src/js/modules/infragistics.ui.toolbar.js +++ b/src/js/modules/infragistics.ui.toolbar.js @@ -80,7 +80,7 @@ return this.settings.localeProperties; }, callbackRenderer: function () { - if (this.settings.callbackRenderer && $.isFunction(this.settings.callbackRenderer)) { + if (this.settings.callbackRenderer && typeof this.settings.callbackRenderer === "function") { return this.settings.callbackRenderer(); } }, @@ -945,7 +945,7 @@ }, tbItemsPropsTraversing = function (key, property) { var scope = o.items[ i ].scope || self; - if (property.action !== undefined && $.isFunction(scope[ property.action ])) { + if (property.action !== undefined && typeof scope[ property.action ] === "function") { scope[ property.action ](newItem, property, itemProps); return; } diff --git a/src/js/modules/infragistics.util.jquery.js b/src/js/modules/infragistics.util.jquery.js index 1d3c17632..73164f3ed 100644 --- a/src/js/modules/infragistics.util.jquery.js +++ b/src/js/modules/infragistics.util.jquery.js @@ -35,7 +35,7 @@ window.$ig = window.$ig || $.ig; $.ig.getWindow = function( elem ) { - return $.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; + return elem != null && elem === elem.window ? elem : elem.nodeType === 9 && elem.defaultView; }; $.fn.startsWith = function (str) { return this[ 0 ].innerHTML.indexOf(str) === 0; @@ -1221,7 +1221,7 @@ var beforeSend = function (jqXHR, options) { if (requestOptions) { - if ($.isFunction(requestOptions.beforeSend)) { + if (typeof requestOptions.beforeSend === "function") { jqXHR.setRequestHeader("Content-Type", contentType); requestOptions.beforeSend.call(this, jqXHR, options, requestOptions); } diff --git a/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js b/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js index 4efd64759..6f45f3b9e 100644 --- a/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js +++ b/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js @@ -183,7 +183,7 @@ QUnit.module("igHTMLEditor unit tests", { buttonCombinationsTest: function () { var i, buttonsNames = arguments; for (i = 0; i < buttonsNames.length; i++) { - if ($.isFunction(this[buttonsNames[i]])) { + if (typeof this[buttonsNames[i]] === "function") { this[buttonsNames[i]](); } } @@ -355,7 +355,7 @@ QUnit.module("igHTMLEditor unit tests", { self.htmlEditor.igHtmlEditor('executeAction', actionName, param); var condition = false; - if ($.isFunction(conditionCallBack)) { + if (typeof conditionCallBack === "function") { condition = conditionCallBack.call(p, self.editorBody); } self.assert.ok(condition, 'Execute action ' + actionName + " combo."); @@ -383,7 +383,7 @@ QUnit.module("igHTMLEditor unit tests", { self.htmlEditor.data("igHtmlEditor")._selectionWrapperSaved.select(p.contents()); button.trigger("click"); var condition = false; - if ($.isFunction(conditionCallBack)) { + if (typeof conditionCallBack === "function") { condition = conditionCallBack.call(p, self.editorBody); } self.assert.ok(condition, buttonName + " combo."); @@ -415,7 +415,7 @@ QUnit.module("igHTMLEditor unit tests", { return $.ig.TestUtil.wait(200); }).then(function () { var condition = false; - if ($.isFunction(conditionCallBack)) { + if (typeof conditionCallBack === "function") { condition = conditionCallBack.call(p, self.editorBody); } combo.igCombo("closeDropDown"); From a34152ad441dc10ee5db76ac85969e7c253d859b Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 11 Feb 2025 18:12:09 +0200 Subject: [PATCH 2/6] fix(*): removing the use of deprecated bind --- demos/video-player/common-features.html | 4 +- ...agistics.ui.editors.knockout-extensions.js | 28 ++++----- src/js/modules/infragistics.ui.dialog.js | 10 ++-- src/js/modules/infragistics.ui.htmleditor.js | 18 +++--- src/js/modules/infragistics.ui.popover.js | 10 ++-- src/js/modules/infragistics.ui.rating.js | 8 +-- src/js/modules/infragistics.ui.shared.js | 8 +-- src/js/modules/infragistics.ui.splitter.js | 28 ++++----- src/js/modules/infragistics.ui.upload.js | 18 +++--- src/js/modules/infragistics.ui.validator.js | 6 +- src/js/modules/infragistics.ui.videoplayer.js | 58 +++++++++---------- src/js/modules/infragistics.ui.zoombar.js | 20 +++---- .../rendering/htmleditor-test.js | 4 +- tests/unit/popover/common/common-test.js | 4 +- tests/unit/splitter/jquery.simulate.js | 4 +- tests/unit/testswarm/inject.js | 8 +-- tests/unit/upload/upload-test.js | 4 +- tests/unit/videoplayer/videoplayer-test.js | 2 +- 18 files changed, 121 insertions(+), 121 deletions(-) diff --git a/demos/video-player/common-features.html b/demos/video-player/common-features.html index 1febf5404..33df8ed7d 100644 --- a/demos/video-player/common-features.html +++ b/demos/video-player/common-features.html @@ -214,7 +214,7 @@ else $("#webMVideo").html($("#webMVideo").html() + 'NO'); - $("#videoPlayer1").igVideoPlayer().bind({ + $("#videoPlayer1").igVideoPlayer().on({ igvideoplayerplaying: function () { playing = true; $('#btnPlay span').html("Pause"); @@ -248,7 +248,7 @@ $("#videoPlayer1").igVideoPlayer("play"); }); - $("#slider").slider({ value: 50 }).bind("slide", function (event, ui) { + $("#slider").slider({ value: 50 }).on("slide", function (event, ui) { var value = ui.value; $("#videoPlayer1").igVideoPlayer("option", "volume", value / 100); }); diff --git a/src/js/extensions/infragistics.ui.editors.knockout-extensions.js b/src/js/extensions/infragistics.ui.editors.knockout-extensions.js index 06a015071..40765c4a4 100644 --- a/src/js/extensions/infragistics.ui.editors.knockout-extensions.js +++ b/src/js/extensions/infragistics.ui.editors.knockout-extensions.js @@ -55,7 +55,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igtexteditorvaluechanged", function (event, args) { + editor.on("igtexteditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.newValue); } else { @@ -65,7 +65,7 @@ } else { //In that case the model is updated on textChanged event - editor.bind("igtexteditortextchanged", function (event, args) { + editor.on("igtexteditortextchanged", function (event, args) { // N.A. December 9th, 2016 #577 Don't update editor value, while typing. It is updated only on blur. editor.data("igTextEditor")._doNotUpdate = true; if (ko.isObservable(valueAccessor().value)) { @@ -77,7 +77,7 @@ if (options.listItems !== undefined) { //In that case the model is updated dropDownItemSelecting event - editor.bind("igtexteditordropdownitemselecting", function (event, args) { + editor.on("igtexteditordropdownitemselecting", function (event, args) { if (ko.isObservable(valueAccessor().value) && args.item !== undefined) { valueAccessor().value(args.item.innerText); } else if (args.item !== undefined) { @@ -115,7 +115,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igdatepickervaluechanged", function (event, args) { + editor.on("igdatepickervaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { //T.P. #153479 Fix to use value instead of text, because editor sets date value and we should rely on that date, but not text. @@ -187,7 +187,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igdateeditorvaluechanged", function (event, args) { + editor.on("igdateeditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { //T.P. #153479 Fix to use value instead of text, because editor sets date value and we should rely on that date, but not text. @@ -259,7 +259,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("ignumericeditorvaluechanged", function (event, args) { + editor.on("ignumericeditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.newValue); } else { @@ -269,7 +269,7 @@ } else { //In that case the model is updated on textChanged event - editor.bind("ignumericeditortextchanged", function (event, args) { + editor.on("ignumericeditortextchanged", function (event, args) { args.owner._processValueChanging(args.text); editor.data("igNumericEditor")._doNotUpdate = true; if (ko.isObservable(valueAccessor().value)) { @@ -323,7 +323,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igcurrencyeditorvaluechanged", function (event, args) { + editor.on("igcurrencyeditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.newValue); } else { @@ -333,7 +333,7 @@ } else { //In that case the model is updated on textChanged event - editor.bind("igcurrencyeditortextchanged", function (event, args) { + editor.on("igcurrencyeditortextchanged", function (event, args) { args.owner._processValueChanging(args.text); editor.data("igCurrencyEditor")._doNotUpdate = true; if (ko.isObservable(valueAccessor().value)) { @@ -385,7 +385,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igpercenteditorvaluechanged", function (event, args) { + editor.on("igpercenteditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.newValue); } else { @@ -395,7 +395,7 @@ } else { //In that case the model is updated on textChanged event - editor.bind("igpercenteditortextchanged", function (event, args) { + editor.on("igpercenteditortextchanged", function (event, args) { args.owner._processValueChanging(args.text); editor.data("igPercentEditor")._doNotUpdate = true; if (ko.isObservable(valueAccessor().value)) { @@ -447,7 +447,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igmaskeditorvaluechanged", function (event, args) { + editor.on("igmaskeditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.newValue); } else { @@ -486,7 +486,7 @@ } //In that case the model is updated on valueChanged event - editor.bind("igcheckboxeditorvaluechanged", function (event, args) { + editor.on("igcheckboxeditorvaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().checked)) { valueAccessor().checked(args.newState); } else { @@ -528,7 +528,7 @@ if (options.updateMode.toLowerCase() === "onchange") { //In that case the model is updated on valueChanged event - editor.bind("igtimepickervaluechanged", function (event, args) { + editor.on("igtimepickervaluechanged", function (event, args) { if (ko.isObservable(valueAccessor().value)) { valueAccessor().value(args.owner.value()); } else { diff --git a/src/js/modules/infragistics.ui.dialog.js b/src/js/modules/infragistics.ui.dialog.js index d687bd697..f88fa7c7e 100644 --- a/src/js/modules/infragistics.ui.dialog.js +++ b/src/js/modules/infragistics.ui.dialog.js @@ -1653,7 +1653,7 @@ } if (id) { button = $("").addClass(css.headerButton + " " + css[ id ]).attr("data-id", id) - .attr("href", "#").attr("role", "button").bind(evts).appendTo(header); + .attr("href", "#").attr("role", "button").on(evts).appendTo(header); $("").addClass(css[ id + "Icon" ]).appendTo(button); // i=order of buttons in header:pin,min,max,close @@ -1970,7 +1970,7 @@ elems = elem.find("*").not(old); if (elems.length) { self._focBind = old.add(elems); - elems.bind(focusEvt); + elems.on(focusEvt); } } self._hasFocus = foc; @@ -2003,7 +2003,7 @@ focusEvt = self._focusEvt = { focus: focusEvt, blur: focusEvt }; } if (track && elem) { - self._focBind = elem.find("*").add(elem).bind(focusEvt); + self._focBind = elem.find("*").add(elem).on(focusEvt); } }, @@ -2088,7 +2088,7 @@ } } }; - elem.bind({ + elem.on({ touchstart: function (e) { evt(e, "start"); }, touchmove: function (e) { evt(e, "move"); }, touchend: function (e) { evt(e); } @@ -2339,7 +2339,7 @@ _onResize: function () { var self = this, div = self.isTopModal() ? self._modalDiv : null; if (!self._winResize) { - $(window).bind("resize", self._winResize = function () { + $(window).on("resize", self._winResize = function () { setTimeout(function () { self._onResize(); }, 50); diff --git a/src/js/modules/infragistics.ui.htmleditor.js b/src/js/modules/infragistics.ui.htmleditor.js index 966a272a4..bdce4c461 100644 --- a/src/js/modules/infragistics.ui.htmleditor.js +++ b/src/js/modules/infragistics.ui.htmleditor.js @@ -1880,7 +1880,7 @@ } }; - $workspaceDocument.find("html").bind("click", function (e) { + $workspaceDocument.find("html").on("click", function (e) { var target = $(e.target); if (target.is("html")) { @@ -1889,12 +1889,12 @@ self._isDirty = true; self._hideDialogs(); e.stopPropagation(); - }).bind("mouseup", function () { + }).on("mouseup", function () { self._onSelectionChange(); }); // K.D. July 17th, 2012 Bug #112076 Need to bind on keydown not keypress in order for it to work in IE/Webkit - $workspaceDocument.bind("keydown", function (e) { + $workspaceDocument.on("keydown", function (e) { var $children, $firstChild; @@ -1922,11 +1922,11 @@ self._onSelectionChange(); }); - $workspaceDocument.bind("cut copy paste", function (e) { + $workspaceDocument.on("cut copy paste", function (e) { self._trigger(e.type, e, { owner: self }); }); - this.element.bind("ightmleditoractionexecuted", function (e, ui) { + this.element.on("ightmleditoractionexecuted", function (e, ui) { if (ui.actionName.toLowerCase() === self.events.undo || ui.actionName.toLowerCase() === self.events.redo) { self._trigger(ui.actionName.toLowerCase(), e, { owner: self }); @@ -2755,12 +2755,12 @@ self.hide(); } }); - this.poContent.bind("keypress", function (e) { + this.poContent.on("keypress", function (e) { if (e.keyCode === $.ui.keyCode.ESCAPE) { self.hide(); } }); - this.element.bind("igpopovershown", function () { + this.element.on("igpopovershown", function () { self.poContent.find("#" + self._id("_linkHref")).focus(); }); }, @@ -2885,7 +2885,7 @@ self.hide(); }); - tablePreview.bind("mouseout", function () { + tablePreview.on("mouseout", function () { cells.removeClass("ui-state-hover"); self.rowsNumField.val(null); self.columnsNumField.val(null); @@ -3591,7 +3591,7 @@ }) }; - toolbars.bind("igtoolbartoolbarbuttonclick", function (e, ui) { + toolbars.on("igtoolbartoolbarbuttonclick", function (e, ui) { if (alignButtons.hasOwnProperty(ui.name)) { $.each(alignButtons, function (buttonName, button) { if (buttonName !== ui.name && diff --git a/src/js/modules/infragistics.ui.popover.js b/src/js/modules/infragistics.ui.popover.js index 6ade2de17..2c119e0bc 100644 --- a/src/js/modules/infragistics.ui.popover.js +++ b/src/js/modules/infragistics.ui.popover.js @@ -639,7 +639,7 @@ if (this.options.headerTemplate.closeButton) { var closeBtn = $("
") .addClass(this.css.closeButtonClass) - .bind("click.popover", this._closeBtnClick.bind(this)) + .on("click.popover", this._closeBtnClick.bind(this)) .appendTo(cnt); if (this.id()) { closeBtn.attr("id", this.id() + "_popover_closeBtn"); @@ -865,8 +865,8 @@ (typeof t[ 0 ] === "object") && (t[ 0 ].nodeType === 1) && ( typeof t[ 0 ].style === "object" ) && ( typeof t[ 0 ].ownerDocument === "object" ) ) ) { - $(t).unbind(showEvt).bind(showEvt, targetShowEvt); - $(t).unbind(hideEvt).bind(hideEvt, targetHideEvt); + $(t).unbind(showEvt).on(showEvt, targetShowEvt); + $(t).unbind(hideEvt).on(hideEvt, targetHideEvt); } else if (this.options.selectors && showEvt) { this.element.find(this.options.selectors).addBack().each(function () { var target = $(this)[ 0 ]; @@ -874,8 +874,8 @@ if (target === self.element[ 0 ]) { return; } - $(target).unbind(showEvt).bind(showEvt, targetShowEvt); - $(target).unbind(hideEvt).bind(hideEvt, targetHideEvt); + $(target).unbind(showEvt).on(showEvt, targetShowEvt); + $(target).unbind(hideEvt).on(hideEvt, targetHideEvt); }); } }, diff --git a/src/js/modules/infragistics.ui.rating.js b/src/js/modules/infragistics.ui.rating.js index 02bf7908d..65423f9d4 100644 --- a/src/js/modules/infragistics.ui.rating.js +++ b/src/js/modules/infragistics.ui.rating.js @@ -421,7 +421,7 @@ // flag if control should use hover-css. Bit 1-has mouse, Bit 2-has focus. me._hasHov = 0; - elem = me._elem = $("
").css(sto).addClass(css.normal).appendTo(elem0).bind(me._evts = { + elem = me._elem = $("
").css(sto).addClass(css.normal).appendTo(elem0).on(me._evts = { mousedown: function (e) { me._doEvt(e, 1); }, mousemove: function (e) { me._doEvt(e, 2); }, mouseleave: function (e) { me._doEvt(e, 3); } @@ -643,7 +643,7 @@ overflow: "visible" }; while (++i < count) { - span = $("").addClass(css.vote).css(cssV).appendTo(div).bind(touch); + span = $("").addClass(css.vote).css(cssV).appendTo(div).on(touch); if (o.disabled) { span.addClass(css.voteDisabled); } @@ -653,7 +653,7 @@ } span[ 0 ]._i = i; span = $("").addClass(css.vote).addClass(css.voteSelected) - .css(cssV).appendTo(sel).bind(touch); + .css(cssV).appendTo(sel).on(touch); if (o.disabled) { span.addClass(css.voteDisabledSelected); } @@ -665,7 +665,7 @@ me._selSwap = span; } span = $("").addClass(css.vote).addClass(css.voteHover) - .css(cssV).appendTo(hov).bind(touch); + .css(cssV).appendTo(hov).on(touch); if (cssi && cssi[ 2 ]) { span.addClass(cssi[ 2 ]); } diff --git a/src/js/modules/infragistics.ui.shared.js b/src/js/modules/infragistics.ui.shared.js index e8f81606a..feccf8181 100644 --- a/src/js/modules/infragistics.ui.shared.js +++ b/src/js/modules/infragistics.ui.shared.js @@ -237,7 +237,7 @@ // TODO we should think of a different way to find the handle as the class can be changed by the user // and it may not be just one class this.handles = $(".ui-igslider-handle", this.element) - .addClass("ui-state-default" + " ui-corner-all").bind({ + .addClass("ui-state-default" + " ui-corner-all").on({ click: function (event) { event.preventDefault(); }, @@ -370,7 +370,7 @@ ((mark.value - o.min) / (o.max - o.min) * 100) + "%" : "0%"); } - this.bookmarks = $(".ui-igslider-bookmark", this.element).addClass("ui-state-default").bind({ + this.bookmarks = $(".ui-igslider-bookmark", this.element).addClass("ui-state-default").on({ mousedown: function (event) { var noCancel = true, bookmarkIndex = $(this).data("index.ui-igslider-bookmark"); @@ -522,7 +522,7 @@ // A.Y. June 6, 2011 Bug# 73864 - the ui.mouse plugin that we extend is not firing _mouseStop unless there is a slide // in which case it fires _mouseStart and then _mouseStop, so we should handle the mouseUp event // unless _mouseStart is fired before that - $(document).bind("mouseup." + this.widgetName, this._mouseUpHandler); + $(document).on("mouseup." + this.widgetName, this._mouseUpHandler); return true; }, @@ -1540,7 +1540,7 @@ self._onKeyDown(e); } }; - e.bind(this._events); + e.on(this._events); }, /************** Helper Functions *******************/ diff --git a/src/js/modules/infragistics.ui.splitter.js b/src/js/modules/infragistics.ui.splitter.js index 385b3403b..346f457a0 100644 --- a/src/js/modules/infragistics.ui.splitter.js +++ b/src/js/modules/infragistics.ui.splitter.js @@ -928,12 +928,12 @@ }; $(document) - .bind(this._getEvent("mouseup") + "." + this.element.attr("id"), + .on(this._getEvent("mouseup") + "." + this.element.attr("id"), this._opt.eventHandlers.documentMouseUp) - .bind(this._getEvent("mousemove") + "." + this.element.attr("id"), + .on(this._getEvent("mousemove") + "." + this.element.attr("id"), this._opt.eventHandlers.documentMouseMove); - $(window).bind("resize." + this.element.attr("id"), + $(window).on("resize." + this.element.attr("id"), this._opt.eventHandlers.windowResize); this._addBarHandlers(); @@ -956,10 +956,10 @@ options = this.options; splitter.bar - .bind(this._getEvent("mousedown"), { + .on(this._getEvent("mousedown"), { self: this }, this._startDrag) - .bind(this._getEvent("mousedown"), function () { + .on(this._getEvent("mousedown"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { @@ -971,17 +971,17 @@ this._splitter.bar.find("." + this.css.resizeHandler + "-" + this.options.orientation) - .bind(this._getEvent("mousedown"), { + .on(this._getEvent("mousedown"), { self: this }, this._startDrag); - splitter.bar.bind(this._getEvent("keydown"), { + splitter.bar.on(this._getEvent("keydown"), { self: this }, this._kbNavigation); //T.P. Bug #155452 fix _addBarHandlers so when under mobile devices mouseenter and mouseleave are not binded if (!this._isTouch()) { - splitter.bar.bind(this._getEvent("mouseenter"), function () { + splitter.bar.on(this._getEvent("mouseenter"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { @@ -990,7 +990,7 @@ $(this).addClass(self.css.barHover); }); - splitter.bar.bind(this._getEvent("mouseleave"), function () { + splitter.bar.on(this._getEvent("mouseleave"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { @@ -1000,7 +1000,7 @@ $(this).removeClass(self.css.barHover); }); } - splitter.bar.bind(this._getEvent("focus"), function () { + splitter.bar.on(this._getEvent("focus"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { @@ -1009,7 +1009,7 @@ $(this).addClass(self.css.barActive); }); - splitter.bar.bind(this._getEvent("blur"), function () { + splitter.bar.on(this._getEvent("blur"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { @@ -1209,7 +1209,7 @@ var self = this, options = this.options; - button.bind(this._getEvent("mouseenter"), function (e) { + button.on(this._getEvent("mouseenter"), function (e) { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { return; @@ -1225,7 +1225,7 @@ } return false; }); - button.bind(this._getEvent("mouseleave"), function () { + button.on(this._getEvent("mouseleave"), function () { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { return; @@ -1234,7 +1234,7 @@ $($(this).parent()).addClass(self.css.barHover); $(this).removeClass(self.css.collapseButtonHover); }); - button.bind("mousedown touchstart", function (e) { + button.on("mousedown touchstart", function (e) { // P.P. 26 June 2015: Bug#200732: Even when the splitter is disabled, the splitbar is still draggable if (options.disabled) { return; diff --git a/src/js/modules/infragistics.ui.upload.js b/src/js/modules/infragistics.ui.upload.js index df071a0b6..975cbf3aa 100644 --- a/src/js/modules/infragistics.ui.upload.js +++ b/src/js/modules/infragistics.ui.upload.js @@ -60,7 +60,7 @@ if (this.options.disabled === true) { this._enableFilePicker(true); } else { - this.element.bind({ + this.element.on({ /* M.H. 27 Jul 2011 - fix bug 77323 */ click: function (e) { e.preventDefault(); @@ -138,7 +138,7 @@ self._attachMouseMove(true); } }; - self.element.bind(this._internalEvents); + self.element.on(this._internalEvents); /* attach onchange property to input type="file" element */ self._filePickerBindChange(); }, @@ -172,7 +172,7 @@ } } }; - filePicker.bind(self._filePickerEvents); + filePicker.on(self._filePickerEvents); }, attachFilePicker: function (e, isHidden) { var self = this, right, bottom, t, l, relativeOffset, @@ -276,7 +276,7 @@ }, _attachMouseMove: function (isToAttach) { if (isToAttach) { - $(document).bind(this.mouseMoveEvent); + $(document).on(this.mouseMoveEvent); } else { $(document).unbind(this.mouseMoveEvent); } @@ -306,7 +306,7 @@ /* filePicker.removeAttr("disabled"); */ this._attachMouseMove(true); /* IE9 fix - unbind mouse over event */ - this.element.bind(this._internalEvents).mouseover(); + this.element.on(this._internalEvents).mouseover(); } else { /*filePicker.attr("disabled", "true"); */ this._attachMouseMove(false); @@ -1935,9 +1935,9 @@ /* M.H. 27 Jul 2011 - fix bug 77162 - analyze file extension icons array */ this._analyzeFileExtensionIcons(); /* M.H. 12 Dec 2012 Fix for bug #129351 */ - $(document).bind("dragenter." + this.element[ 0 ].id, this._docEnter.bind(this)); - $(document).bind("dragover." + this.element[ 0 ].id, this._docOver.bind(this)); - $(document).bind("dragleave." + this.element[ 0 ].id, this._docLeave.bind(this)); + $(document).on("dragenter." + this.element[ 0 ].id, this._docEnter.bind(this)); + $(document).on("dragover." + this.element[ 0 ].id, this._docOver.bind(this)); + $(document).on("dragleave." + this.element[ 0 ].id, this._docLeave.bind(this)); }, _dropFiles: function (e) { var isInit = $("#" + this._id("_ibb")).is(":visible"), @@ -4004,7 +4004,7 @@ .appendTo($("#" + this._id("_summpbar_progress")) .addClass(css.summaryProgressBarInnerProgress)); - $("#" + showHideDetailsId).bind({ + $("#" + showHideDetailsId).on({ click: function (event) { event.preventDefault(); self._onShowHideDetailsClick(); diff --git a/src/js/modules/infragistics.ui.validator.js b/src/js/modules/infragistics.ui.validator.js index a6aabb530..421e2c7a6 100644 --- a/src/js/modules/infragistics.ui.validator.js +++ b/src/js/modules/infragistics.ui.validator.js @@ -1248,7 +1248,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { }, "blur.validator": function (e) { self._validateInternal(element, e, true); } }; - element.bind(evts); + element.on(evts); }, _ensureNotifier: function (options, reinit) { /* Checks for and/or initializes igNotifier */ @@ -1268,7 +1268,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { this.options.notificationOptions, options.notificationOptions )) - .bind({ + .on({ "ignotifiershowing.validator": function (evt, ui) { return args.owner._handleNotifierEvent(evt, ui, "Showing", args); }, @@ -1359,7 +1359,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { if (!this._form._igValidators || !this._form._igValidators.length) { this._form._igValidators = []; - $(this._form).bind("submit.validator", function (e) { + $(this._form).on("submit.validator", function (e) { this._igErrorShown = false; var summaryResult = true, current; for (var i = 0; i < this._igValidators.length; i++) { diff --git a/src/js/modules/infragistics.ui.videoplayer.js b/src/js/modules/infragistics.ui.videoplayer.js index 21fd4d1b9..add3916ff 100644 --- a/src/js/modules/infragistics.ui.videoplayer.js +++ b/src/js/modules/infragistics.ui.videoplayer.js @@ -2473,7 +2473,7 @@ /* if rendered, move it to be always last element in the widget */ // K.D. June 8th, 2011 Bug #78401 Preventing default action on click - $("#" + this._id("_detectError")).appendTo(this.container).bind({ + $("#" + this._id("_detectError")).appendTo(this.container).on({ click: function (event) { event.preventDefault(); } @@ -2656,7 +2656,7 @@ "title": this._getLocaleValue("enterFullscreen"), "data-localeid": "enterFullscreen", "data-localeattr": "title" - }).addClass(css.fullScreenClass).bind({ + }).addClass(css.fullScreenClass).on({ click: function (event) { event.preventDefault(); control._setOption("fullscreen", !control.options.fullscreen); @@ -2672,7 +2672,7 @@ "title": this._getLocaleValue("replayTooltip"), "data-localeid": "replayButton", "data-localeattr": "title" - }).bind({ + }).on({ click: function (event) { event.preventDefault(); if (!$(this).igButton("option", "disabled")) { @@ -2749,7 +2749,7 @@ ulContainer.width(ulContainerWidth); } - this.relatedScrollers = $("a", scrollContainer).bind({ + this.relatedScrollers = $("a", scrollContainer).on({ mouseover: function () { if (!control._isScrolling) { control._isScrolling = true; @@ -2766,7 +2766,7 @@ .each(function (i) { $(this).data("related-index", i); }) - .bind({ + .on({ mouseover: function () { $(this).addClass(control.css.relatedVideoHoverClass).children().filter("div").show(); }, @@ -2883,7 +2883,7 @@ $("
").appendTo(relatedImg.parent()).css("position", "absolute").hide(); - relatedImg.bind({ + relatedImg.on({ load: function () { self._imageLoaded(this); }, @@ -2978,7 +2978,7 @@ if (com.length > 0) { video = this._createVideoElement(this._id("_com_video")).attr("preload", "auto") .appendTo(this.container).addClass(this.css.videoClass) - .bind({ + .on({ ended: function () { var slider = $("#" + control._id("_ctrls_s")), bookmarks = slider.data("igSlider").bookmarks; @@ -3041,7 +3041,7 @@ onlyIcons: true, icons: { primary: this.css.adMsgCloseIconClass }, link: { href: this._const.HREF } - }).addClass(this.css.adMsgCloseClass).bind("click", function (event) { + }).addClass(this.css.adMsgCloseClass).on("click", function (event) { event.preventDefault(); event.stopPropagation(); control.hideAdMessage(); @@ -3054,7 +3054,7 @@ container; container = $("
").attr("id", this._id("_ad_msg_c")) - .addClass(css.adMsgContainerClass).prependTo(this.container).bind({ + .addClass(css.adMsgContainerClass).prependTo(this.container).on({ mouseover: function () { $(this).addClass("ui-state-hover"); }, @@ -3254,7 +3254,7 @@ onlyIcons: true, icons: { primary: css.bannerCloseIconClass }, link: { href: this._const.HREF } - }).bind("click", function (event) { + }).on("click", function (event) { event.preventDefault(); event.stopPropagation(); control.hideBanner($(this).parent().parent().data("banner-index")); @@ -3291,7 +3291,7 @@ container.addClass(banner.css); } - container.bind("click", function (event) { + container.on("click", function (event) { var noCancel = true, args = { @@ -3929,7 +3929,7 @@ } }; - video.bind(this._videoEvents); + video.on(this._videoEvents); }, _onVideoClick: function (allowPlay) { @@ -3981,7 +3981,7 @@ } }; - $(document).bind(this._documentEvts); + $(document).on(this._documentEvts); if (!this.options.browserControls) { // B.P. August 21st, 2018 #1722 currentTime moves as expected @@ -3994,9 +3994,9 @@ control._onControlMouseOut(event); } }; - this.container.bind(this._controlsEvts); + this.container.on(this._controlsEvts); } - this.container.bind(this._generalEvts); + this.container.on(this._generalEvts); }, _handleKbNavigation: function (event) { @@ -4258,7 +4258,7 @@ this._createButton(this._id("_play"), css.centerPlayButtonClass, css.centerPlayButtonIconClass, - "").bind({ + "").on({ click: function (event) { event.preventDefault(); if (event.button === 0) { @@ -4285,7 +4285,7 @@ .attr("href", this._const.HREF).attr("tabIndex", -1) .addClass("ui-state-default").addClass(buttonClass) .appendTo(this.container)); - return $("#" + buttonId).bind({ + return $("#" + buttonId).on({ mouseover: function () { $(this).addClass("ui-state-hover"); }, @@ -4405,7 +4405,7 @@ controlsDiv.parent().css("width", this.options.width); } - $("#" + this._id("_title_ctrls_play")).bind({ + $("#" + this._id("_title_ctrls_play")).on({ click: function (event) { event.preventDefault(); if (event.button === 0 && !control.options.disabled) { @@ -4546,7 +4546,7 @@ $(this).data("bookmark-sec-value", bookmarks[ i ].secondsValue); }); - this.bookmarkElements.bind({ + this.bookmarkElements.on({ click: function (event) { var index = $(this).data("bookmark-index"), mark = control.options.bookmarks[ index ]; @@ -4681,7 +4681,7 @@ this.controls = $(controlsArray); titleOption = autoPlay ? "playing" : "paused"; /* bind events */ - $("#" + this._id("_ctrls_play")).bind({ + $("#" + this._id("_ctrls_play")).on({ click: function (event) { event.preventDefault(); if (!$(this).igButton("option", "disabled")) { @@ -4698,7 +4698,7 @@ "data-localeattr": "title" }); - $("#" + this._id("_ctrls_fs_btn")).bind({ + $("#" + this._id("_ctrls_fs_btn")).on({ click: function (event) { event.preventDefault(); control._setOption("fullscreen", !control.options.fullscreen); @@ -4765,7 +4765,7 @@ endValue: 0 }); - $("#" + this._id("_ctrls_pb")).bind({ + $("#" + this._id("_ctrls_pb")).on({ mousemove: function (e) { if (control.options.showSeekTime && this.offsetWidth > 0) { var relativeX = e.pageX - this.offsetLeft - $(this).igOffset().left, @@ -4785,13 +4785,13 @@ } }); - $("#" + this._id("_ctrls_pl")).bind({ + $("#" + this._id("_ctrls_pl")).on({ click: function (event) { event.preventDefault(); } }); - $("#" + this._id("_ctrls_vc_btn")).bind({ + $("#" + this._id("_ctrls_vc_btn")).on({ mouseover: function () { control._showVolumeSlider(); }, @@ -4819,7 +4819,7 @@ "data-localeattr": "title" }); - $("#" + this._id("_ctrls_vs")).hide().bind({ + $("#" + this._id("_ctrls_vs")).hide().on({ mouseover: function () { control._volumeSliderMouseOut = false; clearTimeout(control._volumeSliderTimeoutId); @@ -4851,7 +4851,7 @@ orientation: "vertical", value: (this.options.muted ? 0 : this.options.volume * 100) }); - $("#" + this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex", -1).bind({ + $("#" + this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex", -1).on({ blur: function () { control._volumeSliderTimeoutId = setTimeout(control._hideVolumeSlider.bind(control), control.options.volumeAutohideDelay); @@ -4866,7 +4866,7 @@ this.controlButtons.each(function (i) { $(this).data("index.control-button", i); }); - this.controlButtons.bind({ + this.controlButtons.on({ keydown: function (event) { control._handleKbNavigation(event); }, @@ -4877,7 +4877,7 @@ control._handleBlurKb(event); } }); - $("#" + this._id("_ctrls_vc_btn")).bind({ + $("#" + this._id("_ctrls_vc_btn")).on({ focus: function () { control._showVolumeSlider(); }, @@ -4896,7 +4896,7 @@ } } }); - $("#" + control._id("_ctrls_vs")).data("igSlider").handle.bind({ + $("#" + control._id("_ctrls_vs")).data("igSlider").handle.on({ keydown: function (event) { if (event.keyCode === $.ui.keyCode.TAB) { event.preventDefault(); diff --git a/src/js/modules/infragistics.ui.zoombar.js b/src/js/modules/infragistics.ui.zoombar.js index 631fca403..0713aeacb 100644 --- a/src/js/modules/infragistics.ui.zoombar.js +++ b/src/js/modules/infragistics.ui.zoombar.js @@ -871,11 +871,11 @@ if (this._dragStart($(evt.target), evt.pageX || evt.originalEvent.clientX, evt)) { // we will bind to move events only after dragStart is detected if (window.navigator.pointerEnabled) { - $(evt.currentTarget).bind("pointermove.zoombar", this._zoombarMouseMoveHandler); + $(evt.currentTarget).on("pointermove.zoombar", this._zoombarMouseMoveHandler); } else if (window.navigator.msPointerEnabled) { - $(evt.currentTarget).bind("MSPointerMove.zoombar", this._zoombarMouseMoveHandler); + $(evt.currentTarget).on("MSPointerMove.zoombar", this._zoombarMouseMoveHandler); } else { - $(evt.currentTarget).bind("mousemove.zoombar", this._zoombarMouseMoveHandler); + $(evt.currentTarget).on("mousemove.zoombar", this._zoombarMouseMoveHandler); } evt.stopPropagation(); evt.preventDefault(); @@ -1352,29 +1352,29 @@ te = {}, pe = {}, me = {}, we = {}; te[ "touchstart." + this.id() ] = this._zoombarTouchStartHandler; te[ "touchend." + this.id() ] = this._zoombarTouchEndHandler; - wnd.bind(te); + wnd.on(te); this.container()[ 0 ].addEventListener("touchmove", this._zoombarTouchMoveHandler); if (window.navigator.pointerEnabled) { pe[ "pointerdown." + this.id() ] = this._zoombarMouseDownHandler; pe[ "pointerup." + this.id() ] = this._zoombarMouseUpHandler; - wnd.bind(pe); + wnd.on(pe); } else if (window.navigator.msPointerEnabled) { pe[ "MSPointerDown." + this.id() ] = this._zoombarMouseDownHandler; pe[ "MSPointerUp." + this.id() ] = this._zoombarMouseUpHandler; - wnd.bind(pe); + wnd.on(pe); } else { me[ "mousedown." + this.id() ] = this._zoombarMouseDownHandler; me[ "mouseup." + this.id() ] = this._zoombarMouseUpHandler; - wnd.bind(me); + wnd.on(me); } we[ "mousewheel." + this.id() ] = this._zoombarMouseWheelHandler; we[ "DOMMouseScroll." + this.id() ] = this._zoombarMouseWheelHandler; - wnd.bind(we); - this._sbt.bind({ + wnd.on(we); + this._sbt.on({ "mouseenter.zoombar": this._scrollbarThumbMouseEnterHandler, "mouseleave.zoombar": this._scrollbarThumbMouseLeaveHandler }); - zwe.bind({ + zwe.on({ "keydown": this._windowKeyDownHandler, "keyup": this._windowKeyUpHandler }); diff --git a/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js b/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js index 6f45f3b9e..d4889ecfa 100644 --- a/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js +++ b/tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js @@ -404,7 +404,7 @@ QUnit.module("igHTMLEditor unit tests", { animationHideDuration: 0 }); - combo.bind("igcombodropdownopened", function () { + combo.on("igcombodropdownopened", function () { combo.igCombo('index', index, null, true); }); @@ -1567,7 +1567,7 @@ QUnit.test('[ID65] igHtmlEditor rendering tests - Adjust domPathToolbar width wh animationHideDuration: 0 }); - combo.bind("igcombodropdownopened", function () { + combo.on("igcombodropdownopened", function () { combo.igCombo('index', 3, null, true); }); diff --git a/tests/unit/popover/common/common-test.js b/tests/unit/popover/common/common-test.js index 06d014426..1bf76eaa3 100644 --- a/tests/unit/popover/common/common-test.js +++ b/tests/unit/popover/common/common-test.js @@ -441,7 +441,7 @@ QUnit.test(testId_32, function (assert) { }, showOn: "mouseenter" }); - $("#img1").bind({ + $("#img1").on({ igpopovershowing: function (event, ui) { if (this.cancelS === false) { return true; @@ -534,7 +534,7 @@ QUnit.test(testId_34, function (assert) { }, showOn: "mouseenter" }); - $("#img1").bind({ + $("#img1").on({ igpopoverhiding: function (event, ui) { if (cancelH === false) { return true; diff --git a/tests/unit/splitter/jquery.simulate.js b/tests/unit/splitter/jquery.simulate.js index 3c45cc702..f67bc02bc 100644 --- a/tests/unit/splitter/jquery.simulate.js +++ b/tests/unit/splitter/jquery.simulate.js @@ -175,7 +175,7 @@ $.extend( $.simulate.prototype, { triggered = true; } - element.bind( "focus", trigger ); + element.on( "focus", trigger ); element[ 0 ].focus(); if ( !triggered ) { @@ -196,7 +196,7 @@ $.extend( $.simulate.prototype, { triggered = true; } - element.bind( "blur", trigger ); + element.on( "blur", trigger ); element[ 0 ].blur(); // blur events are async in IE diff --git a/tests/unit/testswarm/inject.js b/tests/unit/testswarm/inject.js index f2efaaf88..98d435184 100644 --- a/tests/unit/testswarm/inject.js +++ b/tests/unit/testswarm/inject.js @@ -196,7 +196,7 @@ // Screw.Unit // git://github.com/nathansobo/screw-unit.git } else if ( typeof Screw !== "undefined" && typeof jQuery !== 'undefined' && Screw && Screw.Unit ) { - $(Screw).bind("after", function() { + $(Screw).on("after", function() { var passed = $('.passed').length; var failed = $('.failed').length; submit({ @@ -206,10 +206,10 @@ }); }); - $(Screw).bind("loaded", function() { + $(Screw).on("loaded", function() { $('.it') - .bind("passed", window.TestSwarm.heartbeat) - .bind("failed", window.TestSwarm.heartbeat); + .on("passed", window.TestSwarm.heartbeat) + .on("failed", window.TestSwarm.heartbeat); window.TestSwarm.heartbeat(); }); diff --git a/tests/unit/upload/upload-test.js b/tests/unit/upload/upload-test.js index 7ee1a7f56..9e8a4017b 100644 --- a/tests/unit/upload/upload-test.js +++ b/tests/unit/upload/upload-test.js @@ -79,7 +79,7 @@ QUnit.module("igUpload unit tests", { //totalCountUploadedFiles++; this.assert.equal(uploadedBytes, totalSize, 'Uploaded bytes should be equal to total size when status is finished.'); //equal (totalCountUploadedFiles, innerData.countUploadingFiles, 'Count of uploading files should be equal to the inner data.'); - $('#' + uploaderId).bind("iguploadfileuploaded", function (event, data) { + $('#' + uploaderId).on("iguploadfileuploaded", function (event, data) { self.checkUploadedData(uploaderId, fileId); $('#' + uploaderId).unbind("iguploadfileuploaded"); }); @@ -267,7 +267,7 @@ QUnit.test('[ID4] igUpload SINGLE MODE resource test finish file', function (ass progressUrl: 'http://localhost/asdfasdf' }); - uploader.bind("iguploadfileuploaded", function (event, data) { + uploader.on("iguploadfileuploaded", function (event, data) { innerData = uploader.data('igUpload').fileInfoData; self.checkUploadedData(uploaderId, 0); assert.equal($('#' + uploaderId + '_bb').igBrowseButton('option', 'disabled'), false, 'Browse button should be enabled when file is uploaded.'); diff --git a/tests/unit/videoplayer/videoplayer-test.js b/tests/unit/videoplayer/videoplayer-test.js index 8b9396bf4..034d8e579 100644 --- a/tests/unit/videoplayer/videoplayer-test.js +++ b/tests/unit/videoplayer/videoplayer-test.js @@ -919,7 +919,7 @@ QUnit.test('destroy test 27', function(assert) { var a = 0, click = jQuery.Event("click"), player1 = $('#player1'); - player1.bind('click', function () { + player1.on('click', function () { a = 1; }); player1.igVideoPlayerUnitTesting('destroy'); From 6b10ac0b15af9876a302266f0aa299cb8ccf368b Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Wed, 12 Feb 2025 17:39:37 +0200 Subject: [PATCH 3/6] fix(*): more deprecated API usage fixes --- src/js/modules/infragistics.ui.combo.js | 4 ++-- src/js/modules/infragistics.ui.dialog.js | 6 +++--- src/js/modules/infragistics.ui.editors.js | 4 ++-- src/js/modules/infragistics.ui.htmleditor.js | 2 +- src/js/modules/infragistics.ui.popover.js | 12 ++++++------ src/js/modules/infragistics.ui.rating.js | 2 +- src/js/modules/infragistics.ui.shared.js | 12 ++++++------ src/js/modules/infragistics.ui.splitter.js | 18 +++++++++--------- src/js/modules/infragistics.ui.toolbar.js | 4 +--- src/js/modules/infragistics.ui.tree.js | 2 +- src/js/modules/infragistics.ui.upload.js | 10 +++++----- src/js/modules/infragistics.ui.validator.js | 10 +++++----- src/js/modules/infragistics.ui.videoplayer.js | 10 +++++----- src/js/modules/infragistics.ui.zoombar.js | 16 ++++++++-------- tests/unit/popover/common/common-test.js | 4 ++-- tests/unit/splitter/jquery.simulate.js | 4 ++-- tests/unit/upload/upload-test.js | 6 +++--- 17 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/js/modules/infragistics.ui.combo.js b/src/js/modules/infragistics.ui.combo.js index 393db598a..69c031a79 100644 --- a/src/js/modules/infragistics.ui.combo.js +++ b/src/js/modules/infragistics.ui.combo.js @@ -4976,8 +4976,8 @@ this._options.$input.attr("disabled", true); this._options.$hiddenInput.attr("disabled", true); } else { - this._options.$input.removeAttr("disabled"); - this._options.$hiddenInput.removeAttr("disabled"); + this._options.$input.remoteProp("disabled"); + this._options.$hiddenInput.removeProp("disabled"); } }, changeLocale: function () { diff --git a/src/js/modules/infragistics.ui.dialog.js b/src/js/modules/infragistics.ui.dialog.js index f88fa7c7e..92170174e 100644 --- a/src/js/modules/infragistics.ui.dialog.js +++ b/src/js/modules/infragistics.ui.dialog.js @@ -1170,7 +1170,7 @@ this.element.stop(true, true); this._doClose(null, true); if (self._winResize) { - $(window).unbind("resize", self._winResize); + $(window).off("resize", self._winResize); } this.element.children(".ui-igdialog-header").remove(); this.element.children(".ui-igdialog-footer").remove(); @@ -1186,7 +1186,7 @@ if (this.options.resizable) { this.element.resizable("destroy"); } - this.element.unbind(); + this.element.off(); // if (next && next.parentNode === dad) { // dad.insertBefore(elem0, next); @@ -1951,7 +1951,7 @@ } if (remove) { if (self._focBind) { - self._focBind.unbind(focusEvt); + self._focBind.off(focusEvt); delete self._focBind; } return; diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index e2c53d915..3482d8ccd 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -572,7 +572,7 @@ } } if (disabled) { - element.removeAttr("disabled"); + element.removeProp("disabled"); // If we have 'disabled' attribute, then it is applied only when 'disabled' options is not defined. if (this._definedOptions === undefined || this._definedOptions.disabled === undefined) { @@ -2240,7 +2240,7 @@ _enableSpinButton: function (target, type) { if (target && target.attr("disabled")) { target.removeClass(this.css.disabled); - target.removeAttr("disabled"); + target.removeProp("disabled"); target.prop("disabled", false); this._attachButtonsEvents(type, target); } diff --git a/src/js/modules/infragistics.ui.htmleditor.js b/src/js/modules/infragistics.ui.htmleditor.js index bdce4c461..27787616f 100644 --- a/src/js/modules/infragistics.ui.htmleditor.js +++ b/src/js/modules/infragistics.ui.htmleditor.js @@ -2331,7 +2331,7 @@ ``` */ this._superApply(arguments); - $(this.workspace.contentWindow).undelegate(); + $(this.workspace.contentWindow).off(); this._destroyPopovers(); this._viewSourceBtn.igButton("destroy"); this.element.removeClass(this.css.htmlEditor) diff --git a/src/js/modules/infragistics.ui.popover.js b/src/js/modules/infragistics.ui.popover.js index 2c119e0bc..8133900ca 100644 --- a/src/js/modules/infragistics.ui.popover.js +++ b/src/js/modules/infragistics.ui.popover.js @@ -865,8 +865,8 @@ (typeof t[ 0 ] === "object") && (t[ 0 ].nodeType === 1) && ( typeof t[ 0 ].style === "object" ) && ( typeof t[ 0 ].ownerDocument === "object" ) ) ) { - $(t).unbind(showEvt).on(showEvt, targetShowEvt); - $(t).unbind(hideEvt).on(hideEvt, targetHideEvt); + $(t).off(showEvt).on(showEvt, targetShowEvt); + $(t).off(hideEvt).on(hideEvt, targetHideEvt); } else if (this.options.selectors && showEvt) { this.element.find(this.options.selectors).addBack().each(function () { var target = $(this)[ 0 ]; @@ -874,8 +874,8 @@ if (target === self.element[ 0 ]) { return; } - $(target).unbind(showEvt).on(showEvt, targetShowEvt); - $(target).unbind(hideEvt).on(hideEvt, targetHideEvt); + $(target).off(showEvt).on(showEvt, targetShowEvt); + $(target).off(hideEvt).on(hideEvt, targetHideEvt); }); } }, @@ -892,11 +892,11 @@ (typeof t[ 0 ] === "object") && (t[ 0 ].nodeType === 1) && ( typeof t[ 0 ].style === "object" ) && ( typeof t[ 0 ].ownerDocument === "object" ) ) ) { - $(t).unbind(".popover"); + $(t).off(".popover"); } else if (this.options.selectors) { this.element.find(this.options.selectors).addBack().each(function () { var target = $(this); - $(target).unbind(".popover"); + $(target).off(".popover"); }); } }, diff --git a/src/js/modules/infragistics.ui.rating.js b/src/js/modules/infragistics.ui.rating.js index 65423f9d4..302d6e8e1 100644 --- a/src/js/modules/infragistics.ui.rating.js +++ b/src/js/modules/infragistics.ui.rating.js @@ -1112,7 +1112,7 @@ } this.validator(1); if (this._foc) { - this._foc.unbind().remove(); + this._foc.off().remove(); } this._elem.remove(); if (o.theme) { diff --git a/src/js/modules/infragistics.ui.shared.js b/src/js/modules/infragistics.ui.shared.js index feccf8181..02d8a2efe 100644 --- a/src/js/modules/infragistics.ui.shared.js +++ b/src/js/modules/infragistics.ui.shared.js @@ -421,7 +421,7 @@ " ui-igslider-vertical" + " ui-igslider-disabled") .removeData("slider") - .unbind(".slider"); + .off(".slider"); this._mouseDestroy(); @@ -531,7 +531,7 @@ // A.Y. June 6, 2011 Bug# 73864 - _mouseStart is fired so we can unbind our mauseUp handler // as we know now that _mouseStop will be fired - $(document).unbind("mouseup." + this.widgetName, this._mouseUpHandler); + $(document).off("mouseup." + this.widgetName, this._mouseUpHandler); return this._start(event, this._handleIndex); }, @@ -720,7 +720,7 @@ this.handles.attr("disabled", "disabled"); this.element.addClass("ui-disabled"); } else { - this.handles.removeAttr("disabled"); + this.handles.removeProp("disabled"); this.element.removeClass("ui-disabled"); } break; @@ -884,7 +884,7 @@ " ui-widget-content" + " ui-corner-all") .removeData("igProgressBar") - .unbind(".igProgressBar"); + .off(".igProgressBar"); $("#" + this._id("_progress")).remove(); return this; }, @@ -1192,7 +1192,7 @@ if (e.hasClass(o.css.buttonDisabledClass)) { e.removeClass(o.css.buttonDisabledClass); } - e.removeAttr("disabled"); + e.removeProp("disabled"); if (e.is("a") === true) { self._setLinkOptions(true); } @@ -1381,7 +1381,7 @@ _dettachEvents: function () { this._attached = false; - this.element.unbind(this._events); + this.element.off(this._events); }, /* Event Functions */ diff --git a/src/js/modules/infragistics.ui.splitter.js b/src/js/modules/infragistics.ui.splitter.js index 346f457a0..02b876941 100644 --- a/src/js/modules/infragistics.ui.splitter.js +++ b/src/js/modules/infragistics.ui.splitter.js @@ -858,19 +858,19 @@ // D.P. If _create threw this._splitter is not assigned return; } - $(this._splitter.bar).unbind(this._getEvent("focus"), + $(this._splitter.bar).off(this._getEvent("focus"), this._getEvent("blur"), this._getEvent("keydown")); - $(this._splitter.bar.children()[ 0 ]).unbind(this._getEvent("mousedown")); - $(this._splitter.bar.children()[ 1 ]).unbind(this._getEvent("mousedown")); + $(this._splitter.bar.children()[ 0 ]).off(this._getEvent("mousedown")); + $(this._splitter.bar.children()[ 1 ]).off(this._getEvent("mousedown")); //T.P. Bug #155452 fix _removeEventHandlers so when under mobile devices mouseenter and mouseleave are not unbinded if (!this._isTouch()) { - $(this._splitter.bar).unbind(this._getEvent("mouseenter"), + $(this._splitter.bar).off(this._getEvent("mouseenter"), this._getEvent("mouseleave")); - $(this._splitter.bar.children()[ 0 ]).unbind(this._getEvent("mouseenter"), + $(this._splitter.bar.children()[ 0 ]).off(this._getEvent("mouseenter"), this._getEvent("mouseleave")); - $(this._splitter.bar.children()[ 1 ]).unbind(this._getEvent("mouseenter"), + $(this._splitter.bar.children()[ 1 ]).off(this._getEvent("mouseenter"), this._getEvent("mouseleave")); } }, @@ -2299,9 +2299,9 @@ // D.A. 24th October 2013 Remove the attached events to window and document if (evtHandlers) { - $(document).unbind(this._getEvent("mouseup"), evtHandlers.documentMouseUp); - $(document).unbind(this._getEvent("mousemove"), evtHandlers.documentMouseMove); - $(window).unbind("resize", evtHandlers.windowResize); + $(document).off(this._getEvent("mouseup"), evtHandlers.documentMouseUp); + $(document).off(this._getEvent("mousemove"), evtHandlers.documentMouseMove); + $(window).off("resize", evtHandlers.windowResize); } this._superApply(arguments); this._opt = null; diff --git a/src/js/modules/infragistics.ui.toolbar.js b/src/js/modules/infragistics.ui.toolbar.js index 7cf8b9056..b4a1ea3cc 100644 --- a/src/js/modules/infragistics.ui.toolbar.js +++ b/src/js/modules/infragistics.ui.toolbar.js @@ -1360,9 +1360,7 @@ */ // D.U. #177516 12th of August [ igToolbar ] Method destroy remover the toolbar container - this.element - .undelegate() - .unbind(); + this.element.off(); this.collapseBtn .igToolbarButton("destroy") diff --git a/src/js/modules/infragistics.ui.tree.js b/src/js/modules/infragistics.ui.tree.js index f480552d5..1f252ac01 100644 --- a/src/js/modules/infragistics.ui.tree.js +++ b/src/js/modules/infragistics.ui.tree.js @@ -4851,7 +4851,7 @@ this._superApply(arguments); // K.D. February 17th, 2014 Bug #164398 Attaching events only on create as delegate is used instead of bind now. - this.element.undelegate(); + this.element.off(); this.element.removeClass(this.css.tree); this.element.removeClass(this.css.treeCollection); this.element.removeClass(this.css.treeRoot); diff --git a/src/js/modules/infragistics.ui.upload.js b/src/js/modules/infragistics.ui.upload.js index 975cbf3aa..db6353c88 100644 --- a/src/js/modules/infragistics.ui.upload.js +++ b/src/js/modules/infragistics.ui.upload.js @@ -278,7 +278,7 @@ if (isToAttach) { $(document).on(this.mouseMoveEvent); } else { - $(document).unbind(this.mouseMoveEvent); + $(document).off(this.mouseMoveEvent); } }, _setOption: function (key, value) { @@ -303,7 +303,7 @@ if (isDisabled === false) { this.isVisibleFilePicker = false; - /* filePicker.removeAttr("disabled"); */ + /* filePicker.removeProp("disabled"); */ this._attachMouseMove(true); /* IE9 fix - unbind mouse over event */ this.element.on(this._internalEvents).mouseover(); @@ -314,15 +314,15 @@ width: "1px", height: "1px" }); - this.element.unbind(this._internalEvents); + this.element.off(this._internalEvents); } }, destroy: function () { /* $(".selector").igUpload("destroy"); */ - this.element.unbind(this._internalEvents); - this.element.unbind(this.mouseMoveEvent); + this.element.off(this._internalEvents); + this.element.off(this.mouseMoveEvent); this._superApply(arguments); /* M.H. 10 May 2011 - fix bug 75039: remove unnecessary comment and unnecessary line of code */ $.ui.igButton.prototype.destroy.apply(this); diff --git a/src/js/modules/infragistics.ui.validator.js b/src/js/modules/infragistics.ui.validator.js index 421e2c7a6..1c98a09ee 100644 --- a/src/js/modules/infragistics.ui.validator.js +++ b/src/js/modules/infragistics.ui.validator.js @@ -1044,7 +1044,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { case "onchange": case "onblur": if (!this.options.fields && !this.options._control) { // TODO: ignore? - this.element.unbind(".validator"); + this.element.off(".validator"); this._attachFieldEvents(this.element); } break; @@ -1253,7 +1253,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { _ensureNotifier: function (options, reinit) { /* Checks for and/or initializes igNotifier */ if (reinit && options.notifyTarget.data("igNotifier")) { - options.notifyTarget.igNotifier("destroy").unbind(".validator"); + options.notifyTarget.igNotifier("destroy").off(".validator"); } if (!options.notifyTarget.data("igNotifier")) { var args = { @@ -1382,7 +1382,7 @@ $.widget("ui.igValidator", $.ui.igWidget, { this._form._igValidators.splice(index, 1); if (!this._form._igValidators.length) { //also detach handler if all validators are destroyed - $(this._form).unbind("submit.validator"); + $(this._form).off("submit.validator"); } } }, @@ -1765,9 +1765,9 @@ $.widget("ui.igValidator", $.ui.igWidget, { }, _cleanupField: function (options) { var element = this._targetFromOptions(options || this.options); - element.unbind(".validator"); + element.off(".validator"); if (options.notifyTarget && options.notifyTarget.data("igNotifier")) { - options.notifyTarget.igNotifier("destroy").unbind(".validator"); + options.notifyTarget.igNotifier("destroy").off(".validator"); } this._clearMessageTarget(options); if (element.data("igValidatorField")) { diff --git a/src/js/modules/infragistics.ui.videoplayer.js b/src/js/modules/infragistics.ui.videoplayer.js index add3916ff..ff4de2bea 100644 --- a/src/js/modules/infragistics.ui.videoplayer.js +++ b/src/js/modules/infragistics.ui.videoplayer.js @@ -5390,10 +5390,10 @@ if (this._oldHeight) { this.element.css("height", this._oldHeight); } - this.container.unbind(this._generalEvts); - $(document).unbind(this._documentEvts); + this.container.off(this._generalEvts); + $(document).off(this._documentEvts); if (this._controlsEvts) { - this.container.unbind(this._controlsEvts); + this.container.off(this._controlsEvts); } this.container.removeClass(css.baseClasses); @@ -5422,7 +5422,7 @@ // Will recursively call, unbind(), removeData() and remove() on all children! if (this.element.is("video")) { - this.element.unbind(this._videoEvents); + this.element.off(this._videoEvents); this.element.removeClass(css.videoClass); this._restoreExistingVideoProperties(this.element); $(":not(video)", this.container).remove(); @@ -5440,7 +5440,7 @@ }, _destroyBookmarks: function () { if (this.bookmarkElements && this.bookmarkElements.length > 0) { - this.bookmarkElements.unbind(); + this.bookmarkElements.off(); this.bookmarkElements.removeData(); delete this.bookmarkElements; $("#" + this._id("_bookmarks")).remove(); diff --git a/src/js/modules/infragistics.ui.zoombar.js b/src/js/modules/infragistics.ui.zoombar.js index 0713aeacb..1bb9d6032 100644 --- a/src/js/modules/infragistics.ui.zoombar.js +++ b/src/js/modules/infragistics.ui.zoombar.js @@ -898,7 +898,7 @@ } if (this._dragEnd(evt)) { target.removeClass(this.css.windowGrabbingClass); - $(evt.currentTarget).unbind({ + $(evt.currentTarget).off({ "mousemove.zoombar": this._zoombarMouseMoveHandler, "pointermove.zoombar": this._zoombarMouseMoveHandler, "MSPointerMove.zoombar": this._zoombarMouseMoveHandler @@ -1386,29 +1386,29 @@ te = {}, pe = {}, me = {}, we = {}; te[ "touchstart." + this.id() ] = this._zoombarTouchStartHandler; te[ "touchend." + this.id() ] = this._zoombarTouchEndHandler; - wnd.unbind(te); + wnd.off(te); this.container()[ 0 ].removeEventListener("touchmove", this._zoombarTouchMoveHandler); if (window.navigator.pointerEnabled) { pe[ "pointerdown." + this.id() ] = this._zoombarMouseDownHandler; pe[ "pointerup." + this.id() ] = this._zoombarMouseUpHandler; - wnd.unbind(pe); + wnd.off(pe); } else if (window.navigator.msPointerEnabled) { pe[ "MSPointerDown." + this.id() ] = this._zoombarMouseDownHandler; pe[ "MSPointerUp." + this.id() ] = this._zoombarMouseUpHandler; - wnd.unbind(pe); + wnd.off(pe); } else { me[ "mousedown." + this.id() ] = this._zoombarMouseDownHandler; me[ "mouseup." + this.id() ] = this._zoombarMouseUpHandler; - wnd.unbind(me); + wnd.off(me); } we[ "mousewheel." + this.id() ] = this._zoombarMouseWheelHandler; we[ "DOMMouseScroll." + this.id() ] = this._zoombarMouseWheelHandler; - wnd.unbind(we); - this._sbt.unbind({ + wnd.off(we); + this._sbt.off({ "mouseenter.zoombar": this._scrollbarThumbMouseEnterHandler, "mouseleave.zoombar": this._scrollbarThumbMouseLeaveHandler }); - zwe.unbind({ + zwe.off({ "keydown": this._windowKeyDownHandler, "keyup": this._windowKeyUpHandler }); diff --git a/tests/unit/popover/common/common-test.js b/tests/unit/popover/common/common-test.js index 1bf76eaa3..30a641e13 100644 --- a/tests/unit/popover/common/common-test.js +++ b/tests/unit/popover/common/common-test.js @@ -465,7 +465,7 @@ QUnit.test(testId_32, function (assert) { this.testUtil.wait(1000).then(function () { done(); assert.ok($('#img1_popover').css("display") === "none", "Showing cancel failed"); - $("#img1").unbind("igpopovershowing"); + $("#img1").off("igpopovershowing"); }).catch(function (er) { assert.pushResult({ result: false, message: er.message }); done(); @@ -564,7 +564,7 @@ QUnit.test(testId_34, function (assert) { $(target).trigger(event); self.testUtil.wait(1000).then(function () { assert.ok($('#img1_popover').css("display") !== "none", "Cancel hiding failed!"); - $("#img1").unbind("igpopoverhiding"); + $("#img1").off("igpopoverhiding"); done(); }); }).catch(function (er) { diff --git a/tests/unit/splitter/jquery.simulate.js b/tests/unit/splitter/jquery.simulate.js index f67bc02bc..1430049c7 100644 --- a/tests/unit/splitter/jquery.simulate.js +++ b/tests/unit/splitter/jquery.simulate.js @@ -184,7 +184,7 @@ $.extend( $.simulate.prototype, { element.trigger( focusinEvent ); element.triggerHandler( "focus" ); } - element.unbind( "focus", trigger ); + element.off( "focus", trigger ); }, simulateBlur: function() { @@ -214,7 +214,7 @@ $.extend( $.simulate.prototype, { element.trigger( focusoutEvent ); element.triggerHandler( "blur" ); } - element.unbind( "blur", trigger ); + element.off( "blur", trigger ); }, 1 ); } }); diff --git a/tests/unit/upload/upload-test.js b/tests/unit/upload/upload-test.js index 9e8a4017b..7e0a14065 100644 --- a/tests/unit/upload/upload-test.js +++ b/tests/unit/upload/upload-test.js @@ -81,7 +81,7 @@ QUnit.module("igUpload unit tests", { //equal (totalCountUploadedFiles, innerData.countUploadingFiles, 'Count of uploading files should be equal to the inner data.'); $('#' + uploaderId).on("iguploadfileuploaded", function (event, data) { self.checkUploadedData(uploaderId, fileId); - $('#' + uploaderId).unbind("iguploadfileuploaded"); + $('#' + uploaderId).off("iguploadfileuploaded"); }); //equal( $('#' + uploaderId + '_clrabtn').igButton('option', 'disabled'), false, 'When the file is uploaded Clear All button should be enabled.'); } @@ -275,7 +275,7 @@ QUnit.test('[ID4] igUpload SINGLE MODE resource test finish file', function (ass assert.equal(data.fileId, 0, 'Data passed to the event handler should be correct - check id is 0.'); assert.equal(data.filePath, '', 'FilePath should be empty because it is not specified.'); self.checkFormDestroyed(uploaderId, 0); - uploader.unbind("iguploadfileuploaded"); + uploader.off("iguploadfileuploaded"); }); this.uploadNewFile(uploaderId, true); @@ -443,7 +443,7 @@ QUnit.test('[ID10] igUpload MULTIPLE MODE - AUTOSTARTUPLOAD event handling uploa self.checkUploading(data, uploaderId); assert.ok(data.uploadedBytes <= data.totalSize, "Event argument uploadedBytes should be less than totalSize"); if (innerData.countUploadingFiles === innerData.countTotalFiles) { - uploader.unbind("iguploadfileuploading", fileUploaderHandler); + uploader.off("iguploadfileuploading", fileUploaderHandler); $.ig.TestUtil.wait(500).then(function () { assert.equal($('#' + uploaderId + '_summpbar').igProgressBar('option', 'value'), 100, 'Summary progress bar should be 100%.'); assert.equal(innerData.countTotalFiles, 3, 'Count total files should be 3'); From bbb62608e67a0ea80827e5a12a21a9e5c7099b4d Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Thu, 13 Feb 2025 16:53:01 +0200 Subject: [PATCH 4/6] fix(*): replacing the deprecated $.type func --- src/js/modules/infragistics.datasource.js | 222 +++++++++--------- src/js/modules/infragistics.templating.js | 4 +- src/js/modules/infragistics.ui.combo.js | 70 +++--- src/js/modules/infragistics.ui.editors.js | 34 +-- src/js/modules/infragistics.ui.shared.js | 4 +- src/js/modules/infragistics.ui.tree.js | 14 +- src/js/modules/infragistics.ui.upload.js | 18 +- src/js/modules/infragistics.ui.videoplayer.js | 2 +- src/js/modules/infragistics.ui.zoombar.js | 2 +- src/js/modules/infragistics.util.jquery.js | 15 +- 10 files changed, 196 insertions(+), 189 deletions(-) diff --git a/src/js/modules/infragistics.datasource.js b/src/js/modules/infragistics.datasource.js index 0dbcf1f61..c00652801 100644 --- a/src/js/modules/infragistics.datasource.js +++ b/src/js/modules/infragistics.datasource.js @@ -1893,10 +1893,10 @@ /* merge defaults with passed-in values */ if (options) { tempSource = options.dataSource; - if (tempSource && ($.type(tempSource) === "array" || $.type(tempSource) === "object")) { + if (tempSource && ($.ig.util.getType(tempSource) === "array" || $.ig.util.getType(tempSource) === "object")) { /* L.A. 28 August 2012 Fixing bug #119626 When the hierarchical grid is bound to remote data (without load on demand), expanding a root grid row causes an error and no child layouts are shown */ - if (($.type(tempSource) === "object") && options.responseDataKey && options.type !== "json") { + if (($.ig.util.getType(tempSource) === "object") && options.responseDataKey && options.type !== "json") { /* M.H. 14 Sep 2012 Fix for bug #121209: we should preserve metadata */ metadata = tempSource.Metadata; options.dataSource = $.ig.findPath(tempSource, options.responseDataKey); @@ -1917,7 +1917,7 @@ /* M.H. 15 May 2013 Fix for bug 141609: Cell value is split into single character when a flat grid is shown after a hierarchical grid has been expanded */ if (arrayAlready) { this.settings.type = "array"; - } else if (tempSource && ($.type(tempSource) === "array" || $.type(tempSource) === "object")) { + } else if (tempSource && ($.ig.util.getType(tempSource) === "array" || $.ig.util.getType(tempSource) === "object")) { options.dataSource = tempSource; this.settings.dataSource = tempSource; } @@ -2089,19 +2089,19 @@ if (ds === undefined || ds === null) { return "empty"; } - if ($.type(ds) === "function") { + if ($.ig.util.getType(ds) === "function") { // function return "function"; } - if ($.type(ds) === "array") { + if ($.ig.util.getType(ds) === "array") { // string, assume JSON by default and eval it return "array"; } - if ($.type(ds) === "number" || $.type(ds) === "boolean" || $.type(ds) === "date") { + if ($.ig.util.getType(ds) === "number" || $.ig.util.getType(ds) === "boolean" || $.ig.util.getType(ds) === "date") { // data source is either boolean, number date, etc. return "invalid"; } - if ($.type(ds) === "string") { //string or object + if ($.ig.util.getType(ds) === "string") { //string or object ds = $.trim(ds); if (ds.startsWith("/")) { return "remoteUrl"; @@ -2805,7 +2805,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowUpdated) === "function") { + if ($.ig.util.getType(this.settings.rowUpdated) === "function") { if (this.settings.callee) { this.settings.rowUpdated.apply(this.settings.callee, [ { rowIndex: rowIndex, newRow: rowObject, oldRow: oldRow }, this ]); @@ -2862,7 +2862,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowAdded) === "function") { + if ($.ig.util.getType(this.settings.rowAdded) === "function") { if (this.settings.callee) { this.settings.rowAdded.apply(this.settings.callee, [ { rowId: rowId, row: rowObject }, this ]); } else { @@ -2929,7 +2929,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowInserted) === "function") { + if ($.ig.util.getType(this.settings.rowInserted) === "function") { if (this.settings.callee) { this.settings.rowInserted.apply(this.settings.callee, [ { rowId: rowId, row: rowObject, rowIndex: rowIndex }, this ]); @@ -3012,7 +3012,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowDeleted) === "function") { + if ($.ig.util.getType(this.settings.rowDeleted) === "function") { if (this.settings.callee) { this.settings.rowDeleted.apply(this.settings.callee, [ { rowId: rowId, row: row, rowIndex: rowIndex }, this ]); @@ -3068,7 +3068,7 @@ paramType="object" a transaction object returnType="object" a copy of a record from the data source */ - var o = $.type(this._data[ 0 ]) === "array" ? [] : {}, i, originalRec; + var o = $.ig.util.getType(this._data[ 0 ]) === "array" ? [] : {}, i, originalRec; if (this.settings.primaryKey === null) { originalRec = this._data[ parseInt(t.rowId, 10) ]; @@ -3076,7 +3076,7 @@ originalRec = this.findRecordByKey(t.rowId); } /* o = $.extend(true, {}, originalRec); */ - if ($.type(this._data[ 0 ]) !== "array") { + if ($.ig.util.getType(this._data[ 0 ]) !== "array") { for (i in originalRec) { if (originalRec.hasOwnProperty(i)) { o[ i ] = originalRec[ i ]; @@ -3093,7 +3093,7 @@ } /* merge objects or arrays return $.extend(true, {}, o, t.row); */ - if ($.type(o) !== "array") { + if ($.ig.util.getType(o) !== "array") { for (i in t.row) { if (t.row.hasOwnProperty(i)) { o[ i ] = t.row[ i ]; @@ -3502,7 +3502,7 @@ } }, _serializeDate: function (date) { - if ($.type(date) !== "date") { + if ($.ig.util.getType(date) !== "date") { //if the value is not a date don't handle it return date; } @@ -3610,7 +3610,7 @@ if (data) { // M.H. 17 June 2014 Fix for bug #171306: The ig_pk property is missing from the added row object. newRow = row; - if (origDs && data !== origDs && $.type(row) === "object") { + if (origDs && data !== origDs && $.ig.util.getType(row) === "object") { newRow = $.extend(true, {}, row); } if (index >= 0 && index < data.length) { @@ -3641,7 +3641,7 @@ } } } else if (t.type === "row") { - if ($.type(t.row) === "array") { + if ($.ig.util.getType(t.row) === "array") { for (j = 0; j < records.length; j++) { rec = records[ j ]; if (rec) { @@ -3843,7 +3843,7 @@ } else if (t.type === "row" || t.type === "insertrow" || t.type === "newrow") { for (prop in t.row) { if (t.row.hasOwnProperty(prop)) { - if ($.type(t.row[ prop ]) === "date") { + if ($.ig.util.getType(t.row[ prop ]) === "date") { t.row[ prop ] = this._serializeDate(t.row[ prop ]); } else { @@ -4008,7 +4008,7 @@ } else if (this._runtimeType === "json") {// if datasource is indeed url // M.H. 9 Oct 2013 Fix for bug #139006: dataSourceType should be set explicitly when invoke dataBind with remote operations ds = this.dataSource(); - if ($.type(ds) === "string") { //string or object + if ($.ig.util.getType(ds) === "string") { //string or object ds = $.trim(ds); /* N.A. 02/10/2014 Bug #162293 Add support for https requests. */ if (ds.startsWith("/") || ds.startsWith("http://") || ds.startsWith("https://")) { @@ -4088,7 +4088,7 @@ /* there are two cases: 1. string which is either JSON objects or XML string 2. object - already parsed, or XML document element */ - if ($.type(this.dataSource()) === "string") { + if ($.ig.util.getType(this.dataSource()) === "string") { if (p.type === "json") { dsObj = this.stringToJSONObject(this.dataSource()); } else { @@ -4247,8 +4247,8 @@ ds = $.ig.findPath(ds, this.settings.responseDataKey); } if (typeof (field.mapper) === "function" && - $.type(ds) === "array" && ds.length > 0) { - type = $.type(field.mapper(ds[ 0 ])); + $.ig.util.getType(ds) === "array" && ds.length > 0) { + type = $.ig.util.getType(field.mapper(ds[ 0 ])); } else { type = field.type; } @@ -4348,7 +4348,7 @@ if (offsets[ key ].hasOwnProperty(func)) { offset = offsets[ key ][ func ]; obj = this._dataSummaries[ key ][ func ]; - if ($.type(obj) === "string") { + if ($.ig.util.getType(obj) === "string") { this._dataSummaries[ key ][ func ] = new Date(obj); } } @@ -4367,7 +4367,7 @@ if (schema && schema.fields && schema.fields().length > 0 && (this.settings.localSchemaTransform || forceApply)) { this._origDs = this._data; - schema._type = $.type(this._data); + schema._type = $.ig.util.getType(this._data); ds = schema.transform(this._data); this._data = ds; this._dataView = this._data; @@ -4469,7 +4469,7 @@ schema._type = "json"; } /* data may be already a parsed JSON object */ - if ($.type(data) === "string") { + if ($.ig.util.getType(data) === "string") { rawData = JSON.parse(data); } else { rawData = data; @@ -4497,8 +4497,8 @@ } } /* try to analyze and detect automatically */ - data = $.type(data) === "string" ? $.trim(data) : data; - if ((data && $.type(data) === "string" && (data.startsWith("= 0 && this.settings.paging && @@ -4969,7 +4969,7 @@ // we do not want to encode one and the same keyvalue pair twice // M.H. 9 Jan 2014 Fix for bug #158808: When using LoadOnDemand with remote GroupBy for the second child layout, the grouped rows are not properly sorted. url = this.settings.dataSource; - if (url && $.type(url) === "string" && url.indexOf("layout=" + hlayout) >= 0) { + if (url && $.ig.util.getType(url) === "string" && url.indexOf("layout=" + hlayout) >= 0) { url = url.substr(url.indexOf("?") + 1); urlQS = url.split("&"); for (i = 0; i < urlQS.length; i++) { @@ -5016,7 +5016,7 @@ key = f.filterExprUrlKey + "(" + fieldName + ")"; } - if ($.type(ffields[ i ].expr) === "date") { + if ($.ig.util.getType(ffields[ i ].expr) === "date") { d = Date.UTC( ffields[ i ].expr.getFullYear(), ffields[ i ].expr.getMonth(), @@ -5047,7 +5047,7 @@ } /* M.H. 5 Sep 2013 Fix for bug #150774: OData Request ignores Case Sensitivity */ expr = ffields[ i ].expr; - if ($.type(expr) === "string") { + if ($.ig.util.getType(expr) === "string") { if (!f.caseSensitive) { fieldName = "tolower(" + fieldName + ")"; expr = expr.toLowerCase(); @@ -5078,7 +5078,7 @@ } else if (ffields[ i ].cond === "equals") { - if ($.type(ffields[ i ].expr) === "string") { + if ($.ig.util.getType(ffields[ i ].expr) === "string") { params.filteringParams.$filter += fieldName + " eq " + "'" + expr + "'"; } else { @@ -5093,7 +5093,7 @@ ffields[ i ].fieldName + " eq false"; } else if (ffields[ i ].cond === "doesNotEqual") { - if ($.type(ffields[ i ].expr) === "string") { + if ($.ig.util.getType(ffields[ i ].expr) === "string") { params.filteringParams.$filter += fieldName + " ne " + "'" + expr + "'"; } else { @@ -5631,7 +5631,7 @@ p = this.settings.paging, data, resetPaging = false; /* we allow the developer to provide a single string of sort expressions, in the following format: "col1 asc, col2 desc, col3 asc" ... */ - if ($.type(fields) === "string") { + if ($.ig.util.getType(fields) === "string") { fields = this._parseSortExpressions(fields); } if (fields === undefined || fields === null) { @@ -5653,7 +5653,7 @@ } else { data = this.dataView(); } - if ($.type(s.customFunc) === "function") { + if ($.ig.util.getType(s.customFunc) === "function") { // call the function, passing the data to be sorted, the fields, and the direction data = s.customFunc(data, fields, direction); } else { @@ -5672,7 +5672,7 @@ /* we allow the developer to provide a single string of sort expressions, in the following format: "col1 asc, col2 desc, col3 asc" ... */ - if ($.type(fields) === "string") { + if ($.ig.util.getType(fields) === "string") { fields = this._parseSortExpressions(fields); } /* A.T. 21 Jan Fix for bug #63146 - reversing of sorting should be the other @@ -5698,7 +5698,7 @@ this._allDataSorted = (data === this.data()); if (data.length > 1) { /* check if a custom compare function is set */ - if ($.type(s.compareFunc) === "function") { + if ($.ig.util.getType(s.compareFunc) === "function") { data.sort(s.compareFunc(fields, this.settings.schema, direction.toLowerCase().startsWith("asc") ? false : true, @@ -5969,17 +5969,17 @@ if (schema === null || schema === undefined) { throw new Error($.ig.util.getLocaleValue("DataSourceLocale", "filteringNoSchema")); } - if ($.type(fieldExpressions) === "string") { + if ($.ig.util.getType(fieldExpressions) === "string") { expr = fieldExpressions; } - if ($.type(fieldExpressionsOnStrings) === "string") { + if ($.ig.util.getType(fieldExpressionsOnStrings) === "string") { allFieldsExpr = fieldExpressionsOnStrings; - } else if ($.type(fieldExpressionsOnStrings) === "undefined") { + } else if ($.ig.util.getType(fieldExpressionsOnStrings) === "undefined") { fieldExpressionsOnStrings = []; } - if ($.type(fieldExpressions) === "array" && + if ($.ig.util.getType(fieldExpressions) === "array" && fieldExpressions.length === 0 && - $.type(fieldExpressionsOnStrings) === "array" && + $.ig.util.getType(fieldExpressionsOnStrings) === "array" && fieldExpressionsOnStrings.length === 0) { return; } @@ -5998,7 +5998,7 @@ data = this._cachedDataView; } } - if ($.type(f.customFunc) === "function") { + if ($.ig.util.getType(f.customFunc) === "function") { /* call the function, passing the filterExpression object which contains field names/indices, the current expression for the field, as well as condition for the field */ data = f.customFunc(fieldExpressions, data); @@ -6061,7 +6061,7 @@ fieldExpressions[ j ].logic : boolLogic; /* A.T. 18 Jan. 2011 fix for bug 62126 - igDataSource local filtering expressions: the OR operator does not work */ - if (tmpbool === undefined || tmpbool === null || $.type(tmpbool) !== "string") { + if (tmpbool === undefined || tmpbool === null || $.ig.util.getType(tmpbool) !== "string") { tmpbool = "and"; } if (skipRec && tmpbool.toLowerCase() === "and") { @@ -6109,7 +6109,7 @@ fieldExpressionsOnStrings[ j ].logic : boolLogic; /* A.T. 18 Jan. 2011 fix for bug 62126 - igDataSource local filtering expressions: the OR operator does not work */ - if (tmpbool === undefined || tmpbool === null || $.type(tmpbool) !== "string") { + if (tmpbool === undefined || tmpbool === null || $.ig.util.getType(tmpbool) !== "string") { tmpbool = "and"; } if (skipRec && tmpbool.toLowerCase() === "and") { @@ -6336,13 +6336,13 @@ val = this.getCellValue(colKey, rec); /* N.A. 2/27/2015 Task #188905: If val is observable, unwrap it. */ - if ($.type(val) === "function") { + if ($.ig.util.getType(val) === "function") { val = val(); } if (custConds && (f = (custConds[ cond ] || custConds[ colKey + "_" + cond ]))) { func = f.filterFunc; - if ($.type(func) === "function") { + if ($.ig.util.getType(func) === "function") { f = func; } else if (window[ func ] && typeof window[ func ] === "function") { f = window[ func ]; @@ -6359,7 +6359,7 @@ tmpExpr = $.trim(expr); /*if (t === null || t === undefined) { - t = $.type(expr); + t = $.ig.util.getType(expr); } */ if (t === "regexp" || (t === "string" && tmpExpr.startsWith("/") && tmpExpr.endsWith("/"))) { if (t === "regexp") { @@ -6367,7 +6367,7 @@ } return this._findRegExpMatch(val, tmpExpr.substring(1, tmpExpr.length - 1), true); } - if (($.type(val) === "date" && (t === undefined || t === null)) || t === "date") { + if (($.ig.util.getType(val) === "date" && (t === undefined || t === null)) || t === "date") { // parse expr try { expr = this._parser.toDate(expr); @@ -6385,11 +6385,11 @@ } return this._findTimeMatch(val, expr, cond); } - if (($.type(val) === "boolean" && (t === undefined || t === null)) || + if (($.ig.util.getType(val) === "boolean" && (t === undefined || t === null)) || (t === "boolean" || t === "bool")) { return this._findBoolMatch(val, cond); } - if (($.type(val) === "number" && (t === undefined || t === null)) || t === "number") { + if (($.ig.util.getType(val) === "number" && (t === undefined || t === null)) || t === "number") { return this._findNumericMatch(val, expr, cond); } return this._findStringMatch(val, expr, ignoreCase, cond); @@ -6450,7 +6450,7 @@ /* Equals, DoesNotEqual, GreaterThan, LessThan, GreaterThanOrEqualTo, LEssThanOrEqualTo */ _findNumericMatch: function (val, expr, cond) { // if expr is not numeric, convert it - if ($.type(expr) !== "number") { + if ($.ig.util.getType(expr) !== "number") { expr = this._parser.toNumber(expr); } if (cond === "equals") { @@ -6513,7 +6513,7 @@ _getDateParts: function (date) { // returns object containing parts of the data like year, month, day, hours, etc. // if enableUTCDates is true then returns UTC representation of the date object - if (!date || $.type(date) !== "date") { + if (!date || $.ig.util.getType(date) !== "date") { return null; } var yrs, day, mdate, mins, hrs, month; @@ -6559,7 +6559,7 @@ yrs1 = valDateParts.year; month1 = valDateParts.month; } - if ($.type(expr) === "date") { + if ($.ig.util.getType(expr) === "date") { exprDateParts = this._getDateParts(expr); day2 = exprDateParts.day; mday2 = exprDateParts.mdate; @@ -6679,7 +6679,7 @@ hs1 = valDateParts.hours; mins1 = valDateParts.mins; } - if ($.type(expr) === "date") { + if ($.ig.util.getType(expr) === "date") { exprDateParts = this._getDateParts(expr); hs2 = exprDateParts.hours; mins2 = exprDateParts.mins; @@ -6767,7 +6767,7 @@ } } if (dsObj && rec !== undefined && rec !== null) { - if ($.type(rec) === "number") { + if ($.ig.util.getType(rec) === "number") { this._recCount = rec; } else { // try parse @@ -7498,7 +7498,7 @@ this._vgbData = []; this._gbDataView = []; this._gbCollapsed = collapsedRows || this._gbCollapsed; - if ($.type(gbExprs) !== "array" || !gbExprs.length) { + if ($.ig.util.getType(gbExprs) !== "array" || !gbExprs.length) { return data; } for (i = 0; i < gbExprs.length; i++) { @@ -7565,10 +7565,10 @@ }, toDate: function (obj) { /* L.A. 18 June 2012 Fixing bug #113265 Column 'date' shows empty values as 'NaN' */ - if (this.isNullOrUndefined(obj) || obj === "" || $.type(obj) === "function") { + if (this.isNullOrUndefined(obj) || obj === "" || $.ig.util.getType(obj) === "function") { return null; } - if ($.type(obj) === "date") { + if ($.ig.util.getType(obj) === "date") { return obj; } var d; @@ -7580,10 +7580,10 @@ return d; }, toTime: function (obj) { - if (this.isNullOrUndefined(obj) || obj === "" || $.type(obj) === "function") { + if (this.isNullOrUndefined(obj) || obj === "" || $.ig.util.getType(obj) === "function") { return null; } - if ($.type(obj) === "date") { + if ($.ig.util.getType(obj) === "date") { return obj; } var d = new Date(); @@ -7595,11 +7595,11 @@ return result; }, toNumber: function (obj) { - return (this.isNullOrUndefined(obj) || $.type(obj) === "function") ? null : obj * this.num(); + return (this.isNullOrUndefined(obj) || $.ig.util.getType(obj) === "function") ? null : obj * this.num(); }, toBool: function (obj) { // M.H. 25 Jul 2013 Fix for bug #144944: Error gets thrown during data transformation of the values for an unbound column - var typeObj = $.type(obj); + var typeObj = $.ig.util.getType(obj); if (typeObj === "boolean") { return obj; } @@ -7825,7 +7825,7 @@ /* optionally, a developer may decide to set all contents directly in the output object */ results = this._setResKey(resKey, out); /* object is empty and is not an array */ - if (this.isObjEmpty(results) && $.type(results) !== "array") { + if (this.isObjEmpty(results) && $.ig.util.getType(results) !== "array") { results = []; out = results; } @@ -7844,7 +7844,7 @@ */ if (data.length > 0) { - hasArrays = $.type(data[ 0 ]) === "array"; + hasArrays = $.ig.util.getType(data[ 0 ]) === "array"; } for (i = 0; i < data.length; i++) { /* L.A. 23 May 2012 - Fixed bug #112518 The grid cannot bind to an @@ -7891,7 +7891,7 @@ } /* L.A. 14 January 2013 - Fixing bug #130634 - JS errors when having a second child layout and using knockout. */ - if (!root && $.type(data) === "array") { + if (!root && $.ig.util.getType(data) === "array") { root = data; } } @@ -7931,7 +7931,7 @@ if (root === undefined || this.isEmpty(this.schema.searchField)) { root = data; } - if (!root.length && $.type(root) === "object") { + if (!root.length && $.ig.util.getType(root) === "object") { root = [ root ]; } /* traverse root */ @@ -9187,7 +9187,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowUpdated) === "function") { + if ($.ig.util.getType(this.settings.rowUpdated) === "function") { if (this.settings.callee) { this.settings.rowUpdated.apply(this.settings.callee, [ { rowIndex: rowIndex, newRow: rowObject, oldRow: oldRow @@ -9259,7 +9259,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowAdded) === "function") { + if ($.ig.util.getType(this.settings.rowAdded) === "function") { if (this.settings.callee) { this.settings.rowAdded.apply(this.settings.callee, [ { rowId: rowId, row: rowObject @@ -9339,7 +9339,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowInserted) === "function") { + if ($.ig.util.getType(this.settings.rowInserted) === "function") { if (this.settings.callee) { this.settings.rowInserted.apply(this.settings.callee, [ { rowId: rowId, row: rowObject, rowIndex: rowIndex @@ -9481,7 +9481,7 @@ } this._rootds.settings.schema.layouts = this.settings.schema.layouts; } else { - if ($.type(this._rootopts.dataSource) === "string" && + if ($.ig.util.getType(this._rootopts.dataSource) === "string" && this._rootopts.dataSource.indexOf("$callback=?") !== -1) { this._rootds = new $.ig.JSONPDataSource(this._rootopts); } else if (this._rootopts.restSettings && @@ -9547,7 +9547,7 @@ this.root().schema().schema ? this.root().schema().schema.searchField : searchField; if (cd && paths.length > 1 && i < paths.length - 1 && - $.type(cd) !== "array" && cd[ searchField ]) { + $.ig.util.getType(cd) !== "array" && cd[ searchField ]) { cd = cd[ searchField ]; } break; @@ -9603,7 +9603,7 @@ lc++; /* for (name in layouts) { - if (layouts.hasOwnProperty(name) && $.type(layouts[name]) !== "function") { + if (layouts.hasOwnProperty(name) && $.ig.util.getType(layouts[name]) !== "function") { tmp = layouts[name].key; currentLayout = layouts[name]; while (currentLayout.columnLayouts) { @@ -9626,7 +9626,7 @@ */ for (name in layouts) { if (layouts.hasOwnProperty(name)) { - if ($.type(layouts[ name ]) !== "function") { + if ($.ig.util.getType(layouts[ name ]) !== "function") { if (name.startsWith("/")) { name = name.substring(1, name.length - 1); } @@ -9811,7 +9811,7 @@ } var i, schema = this.schema().schema, fields = schema.fields; - if ($.type(fields) !== "array") { + if ($.ig.util.getType(fields) !== "array") { return; } for (i = 0; i < fields.length; i++) { @@ -9901,7 +9901,7 @@ if (dataRow === undefined || dataRow === null) { return []; } - if ($.type(dataRow) === "object") { + if ($.ig.util.getType(dataRow) === "object") { search = data && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey; key = dataRow[ search ]; if (key === undefined || key === null) { @@ -9911,7 +9911,7 @@ key = dataRow; } if (this._metadata && - $.type(this._metadata.ancestors) === "array") { + $.ig.util.getType(this._metadata.ancestors) === "array") { prows = this._metadata.ancestors; propL = this.settings.treeDS.dataLevelKey; res = []; @@ -9991,7 +9991,7 @@ if (level > this._dataBoundDepth) { this._dataBoundDepth = level; } - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { dataLen = data.length; //data = this._transformCallback(data); @@ -10000,7 +10000,7 @@ if (!dataRow) { continue; } - if (dataRow && $.type(dataRow[ layoutKey ]) === "array" && + if (dataRow && $.ig.util.getType(dataRow[ layoutKey ]) === "array" && dataRow[ layoutKey ].length) { this._getDataBoundDepthRecursive(dataRow[ layoutKey ], level + 1); } @@ -10033,7 +10033,7 @@ paramType="object" optional="false" The flat data that will be transformed to hierarchical returnType="object" the transformed data source. */ - if ($.type(data) !== "array") { + if ($.ig.util.getType(data) !== "array") { return data; } var i, rowData, nData, @@ -10146,7 +10146,7 @@ if (!data) { data = this.data(); } - if ($.type(data) === "object") { + if ($.ig.util.getType(data) === "object") { data = s._getDataBySearchField(data); } if (!level) { @@ -10167,7 +10167,7 @@ if (!data) { return data; } - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { if (!this._dataBoundDepth) { this._dataBoundDepth = 0; } @@ -10192,7 +10192,7 @@ } this._flatData.push(dataRow); nData.push(dataRow); - hasChildren = $.type(layout) === "array"; + hasChildren = $.ig.util.getType(layout) === "array"; lLen = -1; if (hasChildren) { lLen = layout.length; @@ -10290,7 +10290,7 @@ if (!level) { level = 0; } - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { dataLen = data.length; for (i = 0; i < dataLen; i++) { dataRow = data[ i ]; @@ -10322,7 +10322,7 @@ obj.visibleRecordsCount++; } if (dataRow && - $.type(dataRow[ layoutKey ]) === "array" && + $.ig.util.getType(dataRow[ layoutKey ]) === "array" && dataRow[ layoutKey ].length) { this._generateFlatDataRecursive( dataRow[ layoutKey ], level + 1, obj, !exp || parentCollapsed @@ -10502,7 +10502,7 @@ _requestDataSuccess: function (requestArgs, data) { var layoutKey = this.settings.treeDS.childDataKey, layoutData, level, record, callbackArgs, expand; - if ($.type(data) === "object") { + if ($.ig.util.getType(data) === "object") { record = requestArgs.record; callbackArgs = requestArgs.callbackArgs; expand = requestArgs.expand; @@ -10606,7 +10606,7 @@ url = s.dataSourceUrl + "?" + this._encodeUrlPath(path, record[ s.dataLevelKey ]); func = s.customEncodeUrlFunc; if (func) { - if ($.type(func) !== "function") { + if ($.ig.util.getType(func) !== "function") { if (window[ func ] && typeof window[ func ] === "function") { func = window[ func ]; } else { @@ -10624,7 +10624,7 @@ success: function (data, textStatus, jqXHR) { var func = s.requestDataErrorCallback, noCancel = true; - if ($.type(func) === "function") { + if ($.ig.util.getType(func) === "function") { noCancel = func(args, data, textStatus, jqXHR); } if (noCancel) { @@ -10633,7 +10633,7 @@ }, error: function (jqXHR, textStatus, errorThrown) { var func = s.requestDataErrorCallback; - if ($.type(func) === "function") { + if ($.ig.util.getType(func) === "function") { func(args, jqXHR, textStatus, errorThrown); } } @@ -10649,7 +10649,7 @@ expand = resObj.expand, callback = callbackArgs.callback, args = callbackArgs.args; - if (!callback || $.type(callback) !== "function") { + if (!callback || $.ig.util.getType(callback) !== "function") { return; } callback(rec, expand, res, args); @@ -10737,13 +10737,13 @@ if (expand && treeSettings.enableRemoteLoadOnDemand) { layout = record[ layoutKey ]; if (layout === true || - ($.type(layout) === "array" && !layout.length)) { + ($.ig.util.getType(layout) === "array" && !layout.length)) { // async call func = treeSettings.requestDataCallback; - if ($.type(func) === "string") { + if ($.ig.util.getType(func) === "string") { func = window[ func ]; } - if ($.type(func) !== "function") { + if ($.ig.util.getType(func) !== "function") { func = this._requestData.bind(this); } func(record, expand, callbackArgs); @@ -10844,7 +10844,7 @@ var s = this.settings.sorting, schema, sortF, convertFunc, settings = this.settings, self = this; /* check if there is a custom function defined */ - if ($.type(s.customFunc) === "function") { + if ($.ig.util.getType(s.customFunc) === "function") { // call the function, passing the data to be sorted, the fields, and the direction data = s.customFunc(data, fields, direction); } else { @@ -10860,7 +10860,7 @@ direction = ""; } /* check if a custom compare function is set */ - if ($.type(s.compareFunc) === "function") { + if ($.ig.util.getType(s.compareFunc) === "function") { sortF = s.compareFunc; } else { sortF = function (grid, fields, schema, reverse, convertf, caseSensitive) { @@ -10870,7 +10870,7 @@ // L.A. 11 January 2013 - Fixing bug #130576 // L.A. 09 August 2012 - Fixing bug #118640 When the grid is bound to UTC dates // (remote or local data), grouping a time-formatted date column produces incorrect groups - if ($.type(x) === "date" && $.type(y) === "date") { + if ($.ig.util.getType(x) === "date" && $.ig.util.getType(y) === "date") { if (format === "time" || format === "timeLong" || format === "h:mm:ss tt") { // Create date objects with fake year // M.H. 23 Oct 2013 Fix for bug #155639: Unable to sort date column when format is "h:mm:ss tt" @@ -10978,7 +10978,7 @@ // we allow the developer to provide a single string of sort expressions, in the following format: // "col1 asc, col2 desc, col3 asc" ... - if ($.type(fields) === "string") { + if ($.ig.util.getType(fields) === "string") { fields = this._parseSortExpressions(fields); } /* A.T. 21 Jan Fix for bug #63146 - reversing of sorting should be the @@ -11133,21 +11133,21 @@ if (schema === null || schema === undefined) { throw new Error($.ig.util.getLocaleValue("DataSourceLocale", "filteringNoSchema")); } - if ($.type(fieldExpressions) === "string") { + if ($.ig.util.getType(fieldExpressions) === "string") { expr = fieldExpressions; } - if ($.type(fieldExpressionsOnStrings) === "string") { + if ($.ig.util.getType(fieldExpressionsOnStrings) === "string") { allFieldsExpr = fieldExpressionsOnStrings; - } else if ($.type(fieldExpressionsOnStrings) === "undefined") { + } else if ($.ig.util.getType(fieldExpressionsOnStrings) === "undefined") { fieldExpressionsOnStrings = []; } - if ($.type(fieldExpressions) === "array" && + if ($.ig.util.getType(fieldExpressions) === "array" && fieldExpressions.length === 0 && - $.type(fieldExpressionsOnStrings) === "array" && + $.ig.util.getType(fieldExpressionsOnStrings) === "array" && fieldExpressionsOnStrings.length === 0) { return; } - if ($.type(f.customFunc) === "function") { + if ($.ig.util.getType(f.customFunc) === "function") { /* call the function, passing the filterExpression object which contains field names/indices, the current expression for the field, as well as condition for the field */ filteredData = f.customFunc(fieldExpressions, data); @@ -11220,7 +11220,7 @@ fieldExpressions[ j ].logic : boolLogic; /* A.T. 18 Jan. 2011 fix for bug 62126 - igDataSource local filtering expressions: the OR operator does not work */ - if (tmpbool === undefined || tmpbool === null || $.type(tmpbool) !== "string") { + if (tmpbool === undefined || tmpbool === null || $.ig.util.getType(tmpbool) !== "string") { tmpbool = "and"; } if (skipRec && tmpbool.toLowerCase() === "and") { @@ -11269,7 +11269,7 @@ fieldExpressionsOnStrings[ j ].logic : boolLogic; /* A.T. 18 Jan. 2011 fix for bug 62126 - igDataSource local filtering expressions: the OR operator does not work */ - if (tmpbool === undefined || tmpbool === null || $.type(tmpbool) !== "string") { + if (tmpbool === undefined || tmpbool === null || $.ig.util.getType(tmpbool) !== "string") { tmpbool = "and"; } if (skipRec && tmpbool.toLowerCase() === "and") { @@ -11438,7 +11438,7 @@ var data = this._data, resRecord, search, key, objPath = { path: "" }, path, len = data ? data.length : 0; search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey; - if ($.type(record) !== "object") { + if ($.ig.util.getType(record) !== "object") { key = record; } else { key = record[ search ]; @@ -11688,7 +11688,7 @@ if (autoCommit === true) { this.commit(rowId); } - if ($.type(this.settings.rowInserted) === "function") { + if ($.ig.util.getType(this.settings.rowInserted) === "function") { if (this.settings.callee) { this.settings.rowInserted.apply(this.settings.callee, [ { rowId: rowId, row: rowObject, parentRowId: parentRowId, rowIndex: rowIndex }, this ]); @@ -11769,7 +11769,7 @@ } if (!this._isHierarchicalDataSource && data === origDs) { - if ($.type(row) === "object") { + if ($.ig.util.getType(row) === "object") { newRow = $.extend(true, {}, row); } if (this.settings.treeDS.foreignKey !== null) { diff --git a/src/js/modules/infragistics.templating.js b/src/js/modules/infragistics.templating.js index 54e875b78..baf35b7d5 100644 --- a/src/js/modules/infragistics.templating.js +++ b/src/js/modules/infragistics.templating.js @@ -349,7 +349,7 @@ }, _populateTemplate: function (template, data) { var i, j, result = "", temp; - if ($.type(data) !== "array") { + if ($.ig.util.getType(data) !== "array") { for (i = 0; i < this.tokens.length; i++) { template = this._populateArgumentValue(data, this.tokens[ i ], template); } @@ -373,7 +373,7 @@ }, _compileTemplate: function (template, data) { var i, j, k, result = "", temp, tempArgs = [ ], arg = "", f; - if ($.type(data) !== "array") { + if ($.ig.util.getType(data) !== "array") { for (j = 0; j < this.args.length; j++) { arg = this.args[ j ]; for (i = 0; i < this.tokens.length; i++) { diff --git a/src/js/modules/infragistics.ui.combo.js b/src/js/modules/infragistics.ui.combo.js index 69c031a79..d7c2e19ea 100644 --- a/src/js/modules/infragistics.ui.combo.js +++ b/src/js/modules/infragistics.ui.combo.js @@ -1705,7 +1705,7 @@ if (!options.textKey) { if (options.valueKey) { options.textKey = options.valueKey; - } else if (firstDataItem && $.type(firstDataItem) === "object") { + } else if (firstDataItem && $.ig.util.getType(firstDataItem) === "object") { // Use first data source column for (key in firstDataItem) { @@ -2067,7 +2067,7 @@ _formatItem: function (item) { if ($.ig && $.ig.formatter) { if (this.options.format === "auto" && - ($.type(item) === "date" || $.type(item) === "number")) { + ($.ig.util.getType(item) === "date" || $.ig.util.getType(item) === "number")) { item = $.ig.formatter({ "val": item, "reg": $.ig.regional[ this.options.regional ] @@ -2523,15 +2523,15 @@ _convertToArrayOfObjects: function (options) { var curData, len, i, ds; - if ($.type(options.dataSource) === "object" && (options.dataSource._data !== null && + if ($.ig.util.getType(options.dataSource) === "object" && (options.dataSource._data !== null && options.dataSource._data !== undefined)) { ds = options.dataSource._data; } else { ds = options.dataSource; } - if ($.type(ds) === "array" && ($.type(ds[ 0 ]) === "number" || - $.type(ds[ 0 ]) === "string" || $.type(ds[ 0 ]) === "date")) { + if ($.ig.util.getType(ds) === "array" && ($.ig.util.getType(ds[ 0 ]) === "number" || + $.ig.util.getType(ds[ 0 ]) === "string" || $.ig.util.getType(ds[ 0 ]) === "date")) { for (i = 0, len = ds.length; i < len; i++) { curData = ds[ i ]; @@ -2624,7 +2624,7 @@ $items = $items || this._$items(); // Handle data as array - if ($.type(data) !== "array") { + if ($.ig.util.getType(data) !== "array") { data = [ data ]; } @@ -2647,7 +2647,7 @@ $items = $items || this._$items(); // Handle value as array - if ($.type(value) !== "array") { + if ($.ig.util.getType(value) !== "array") { value = [ value ]; } @@ -2671,7 +2671,7 @@ var i, result = $(); - if ($.type(items) !== "array") { + if ($.ig.util.getType(items) !== "array") { items = [ items ]; } @@ -2714,11 +2714,11 @@ var data2Len, self = this; - if ($.type(data1) !== "array") { + if ($.ig.util.getType(data1) !== "array") { data1 = [ data1 ]; } - if ($.type(data2) !== "array") { + if ($.ig.util.getType(data2) !== "array") { data2 = [ data2 ]; } @@ -2807,7 +2807,7 @@ } // Handle item as array - if ($.type(item) !== "array") { + if ($.ig.util.getType(item) !== "array") { item = [ item ]; } @@ -2840,7 +2840,7 @@ var data, i, len, result = [ ]; - if ($.type(value) !== "array") { + if ($.ig.util.getType(value) !== "array") { value = [ value ]; } @@ -2887,7 +2887,7 @@ result = [ ]; // Handle data as array - if ($.type(data) !== "array") { + if ($.ig.util.getType(data) !== "array") { data = [ data ]; } @@ -3019,7 +3019,7 @@ mode = this.options.mode; // Handle selectedItems option - if ($.type(selItems) === "array") { + if ($.ig.util.getType(selItems) === "array") { for (i = 0; i < selItems.length; i++) { curSelItem = selItems[ i ]; curIndex = curSelItem.index; @@ -4976,8 +4976,8 @@ this._options.$input.attr("disabled", true); this._options.$hiddenInput.attr("disabled", true); } else { - this._options.$input.remoteProp("disabled"); - this._options.$hiddenInput.removeProp("disabled"); + this._options.$input[0].removeAttribute("disabled"); + this._options.$hiddenInput[0].removeAttribute("disabled"); } }, changeLocale: function () { @@ -5129,7 +5129,7 @@ self = this, lod = this.options.loadOnDemandSettings, options = this.options, - isStringDataSource = $.type(options.dataSource) === "string", + isStringDataSource = $.ig.util.getType(options.dataSource) === "string", url = options.dataSourceUrl; // Set the data source that should be used @@ -5144,7 +5144,7 @@ } // P.P. 29-June-2015 Bug #201942: We need to unwrap the data here, because of the following logic. - if ($.type(options.dataSource) === "function") { + if ($.ig.util.getType(options.dataSource) === "function") { options.dataSource = options.dataSource(); } @@ -5208,7 +5208,7 @@ } // S.T. Feb 24th, 2015 Bug #189447: Handle when data source is JSONP. - if ($.type(options.dataSource) === "string" && + if ($.ig.util.getType(options.dataSource) === "string" && !options.dataSourceType && $.ig.util.isJsonpUrl(options.dataSource)) { @@ -5316,7 +5316,7 @@ if (firstDsRow.hasOwnProperty(field)) { schema.fields.push({ name: field, - type: $.type(firstDsRow[ field ]) + type: $.ig.util.getType(firstDsRow[ field ]) }); } } @@ -5329,7 +5329,7 @@ _generateExpressions: function (texts) { var i, expressions = [ ]; - if ($.type(texts) === "string") { + if ($.ig.util.getType(texts) === "string") { // K.D. March 3rd, 2015 Bug #189365 When clearing the filter leave the array empty. if (texts.length > 0 || (this._options.expression && @@ -5345,9 +5345,9 @@ cond: this._filteringCondition() }); } - } else if ($.type(texts) === "array") { + } else if ($.ig.util.getType(texts) === "array") { for (i = 0; i < texts.length; i++) { - if ($.type(texts[ i ]) === "string") { + if ($.ig.util.getType(texts[ i ]) === "string") { expressions.push({ fieldName: this.options.textKey, expr: texts[ i ], @@ -5381,7 +5381,7 @@ } }; - if ($.type(texts) === "string") { + if ($.ig.util.getType(texts) === "string") { texts = [ texts ]; } @@ -5395,7 +5395,7 @@ }); if (texts.length > 0) { - if ($.type(types[ this.options.highlightMatchesMode ]) === "function") { + if ($.ig.util.getType(types[ this.options.highlightMatchesMode ]) === "function") { pattern = types[ this.options.highlightMatchesMode ](texts); } else { throw new Error(this._getLocaleValue("errorUnrecognizedHighlightMatchesMode")); @@ -5815,7 +5815,7 @@ var curCallback, i, callbacks = this._options.internalSelChangeSubs; - if ($.type(callbacks) === "array") { + if ($.ig.util.getType(callbacks) === "array") { for (i = 0; i < callbacks.length; i++) { curCallback = callbacks[ i ]; @@ -6194,7 +6194,7 @@ $items = this._$items(), result = null; - if ($.type(value) === "array") { + if ($.ig.util.getType(value) === "array") { // Filter duplicate values value = $.grep(value, function (val, index) { return self._isValueInArray(val, value) === index; @@ -6247,7 +6247,7 @@ dataLen = data.length, valKey = this.options.valueKey; - if ($.type(index) === "array") { + if ($.ig.util.getType(index) === "array") { value = [ ]; for (i = 0; i < index.length; i++) { @@ -6552,7 +6552,7 @@ self._updateItems(offset); } - if ($.type(callback) === "function") { + if ($.ig.util.getType(callback) === "function") { callback(); } @@ -6672,7 +6672,7 @@ self.clearFiltering(event); } - if ($.type(callback) === "function") { + if ($.ig.util.getType(callback) === "function") { callback(); } @@ -6808,7 +6808,7 @@ returnValue = { combo: this, selectionCanceled: false }; // Use first data when multi selection is not enabled - data = ($.type(data) === "array" && !multiSelEnabled) ? data[ 0 ] : data; + data = ($.ig.util.getType(data) === "array" && !multiSelEnabled) ? data[ 0 ] : data; items = this._itemsFromData(data); options = options || {}; @@ -6823,7 +6823,7 @@ return returnValue; } - if ($.type(items) !== "array") { + if ($.ig.util.getType(items) !== "array") { items = [ items ]; } @@ -7162,7 +7162,7 @@ return indexes; } - if ($.type(index) !== "array") { + if ($.ig.util.getType(index) !== "array") { index = [ index ]; } @@ -7226,7 +7226,7 @@ return this; } - if ($.type(items) !== "array") { + if ($.ig.util.getType(items) !== "array") { items = [ items ]; } @@ -7376,7 +7376,7 @@ var i, len, dataToDeselect = [ ]; - if ($.type(index) !== "array") { + if ($.ig.util.getType(index) !== "array") { index = [ index ]; } diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index 3482d8ccd..7756c75a5 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -572,7 +572,7 @@ } } if (disabled) { - element.removeProp("disabled"); + element[0].removeAttribute("disabled"); // If we have 'disabled' attribute, then it is applied only when 'disabled' options is not defined. if (this._definedOptions === undefined || this._definedOptions.disabled === undefined) { @@ -990,8 +990,8 @@ //Default value we don't do anything unless we implement setOption related to that. this._editorInput.prop("readonly", false); this._valueInput.prop("readonly", false); - this._editorInput.prop("disabled", false); - this._valueInput.prop("disabled", false); + this._editorInput[0].removeAttribute("disabled"); + this._valueInput[0].removeAttribute("disabled"); this._editorContainer.removeClass(this.css.disabled); this._attachEvents(); }, @@ -1001,8 +1001,8 @@ this._valueInput.prop("disabled", true); this._disableEditor(true); } else { - this._editorInput.prop("disabled", false); - this._valueInput.prop("disabled", false); + this._editorInput[0].removeAttribute("disabled"); + this._valueInput[0].removeAttribute("disabled"); if (!this.options.readOnly) { this._setEditableMode(); } @@ -2240,8 +2240,8 @@ _enableSpinButton: function (target, type) { if (target && target.attr("disabled")) { target.removeClass(this.css.disabled); - target.removeProp("disabled"); - target.prop("disabled", false); + target[0].removeAttribute("disabled"); + target[0].removeAttribute("disabled"); this._attachButtonsEvents(type, target); } }, @@ -5072,7 +5072,7 @@ return value; } - if ($.type(value) !== "number") { + if ($.ig.util.getType(value) !== "number") { // In case of IME input digits we need to convert // value = $.ig.util.replaceJpToEnNumbers(value); @@ -8048,9 +8048,9 @@ _setOption: function (option, value) { // igDateEditor /* igDateEditor custom setOption goes here */ var prevValue = this.options[ option ], date; - if ($.type(prevValue) === "date") { + if ($.ig.util.getType(prevValue) === "date") { date = this._getDateObjectFromValue(value); - if ($.type(date) === "date" && (prevValue.getTime() === date.getTime())) { + if ($.ig.util.getType(date) === "date" && (prevValue.getTime() === date.getTime())) { return; } } else if (prevValue === value) { @@ -9251,7 +9251,7 @@ } return; } - if ($.type(value) === "date") { + if ($.ig.util.getType(value) === "date") { parsedVal = value; } else { @@ -9394,7 +9394,7 @@ date = new Date(parseInt(value.replace(this._mvcDateRegex, "$1"), 10)); // V. A. December 4th, 2019 Bug: #2016 In igDateEditor with the input and display format of HH:mm:ss.fff, millisecond part becomes 0 in display text and in value when the focus is blurred. - } else if ($.type(value) === "date") { + } else if ($.ig.util.getType(value) === "date") { date = new Date(value.getTime()); } else { date = new Date(value); @@ -9467,7 +9467,7 @@ midDayStartIndex = this._dateIndices.tt, millisecondsStartIndex = this._dateIndices.ff, extractedDate = ""; - if (value === "" || value === null || $.type(value) === "date") { + if (value === "" || value === null || $.ig.util.getType(value) === "date") { // That case is when in the process value changing the value is equal to the empty mask. We don"t have any user input. return extractedDate; @@ -12682,7 +12682,7 @@ return $.ui.igTextEditor.prototype.selectedListIndex.call(this, index); }, _getEditModeValue: function (val) { // igTimePicker - if ($.type(val) === "date") { + if ($.ig.util.getType(val) === "date") { return this._updateMaskedValue(val, true); } else { return this._super(); @@ -12761,7 +12761,7 @@ } }, value: function (newValue) { //igTimePicker - if (newValue === undefined || $.type(newValue) === "date") { + if (newValue === undefined || $.ig.util.getType(newValue) === "date") { return this._super(newValue); } else { return this._super(this._parseDateFromMaskedValue(newValue)); @@ -12774,7 +12774,7 @@ } }, _updateDropdownSelection: function (currentVal) { //igTimePicker - if ($.type(currentVal) === "date") { + if ($.ig.util.getType(currentVal) === "date") { this._super(currentVal); } else { if (this.options.dataMode === "displayModeText") { @@ -12796,7 +12796,7 @@ } }, _applyOptions: function () { // igTimePicker - if ($.type(this.options.value) !== "date" && this.options.value !== null) { + if ($.ig.util.getType(this.options.value) !== "date" && this.options.value !== null) { // S.S. April 23rd, 2018 #1701 igTimePicker with JSON date format does not display the value var convertedValue = this._getDateObjectFromValue(this.options.value); if (!isNaN(convertedValue)) { diff --git a/src/js/modules/infragistics.ui.shared.js b/src/js/modules/infragistics.ui.shared.js index 02d8a2efe..136b52693 100644 --- a/src/js/modules/infragistics.ui.shared.js +++ b/src/js/modules/infragistics.ui.shared.js @@ -720,7 +720,7 @@ this.handles.attr("disabled", "disabled"); this.element.addClass("ui-disabled"); } else { - this.handles.removeProp("disabled"); + this.handles[0].removeAttribute("disabled"); this.element.removeClass("ui-disabled"); } break; @@ -1192,7 +1192,7 @@ if (e.hasClass(o.css.buttonDisabledClass)) { e.removeClass(o.css.buttonDisabledClass); } - e.removeProp("disabled"); + e[0].removeAttribute("disabled"); if (e.is("a") === true) { self._setLinkOptions(true); } diff --git a/src/js/modules/infragistics.ui.tree.js b/src/js/modules/infragistics.ui.tree.js index 1f252ac01..526816581 100644 --- a/src/js/modules/infragistics.ui.tree.js +++ b/src/js/modules/infragistics.ui.tree.js @@ -1966,7 +1966,7 @@ } } else if (!this.options.dataSource && this.options.dataSourceUrl) { this.options.dataSource = this.options.dataSourceUrl; - } else if ($.type(this.options.dataSource) === "object" && + } else if ($.ig.util.getType(this.options.dataSource) === "object" && typeof this.options.dataSource._encodeHierarchicalUrlParams !== "function" && typeof this.options.dataSource._xmlToArray !== "function" && !this.options.dataSourceType) { @@ -3422,14 +3422,14 @@ find(".ui-igtree-noderoot").length || this.element.find(".ui-igtree-noderoot").length <= 0) { if (dataIndex === 0) { - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { this.options.dataSource.root()._data = data.concat(this.options.dataSource.root()._data); } else { this.options.dataSource.root()._data = [ data ] .concat(this.options.dataSource.root()._data); } } else if (!dataIndex) { - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { for (i = 0; i < data.length; i++) { this.options.dataSource.root()._data.push(data[ i ]); } @@ -3445,11 +3445,11 @@ // K.D. November 14th, 2014 Bug #185180 In some cases the child data prop is an empty object and it should be made an array. if (!originalData.hasOwnProperty(binding.childDataProperty) || - $.type(originalData[ binding.childDataProperty ]) !== "array") { + $.ig.util.getType(originalData[ binding.childDataProperty ]) !== "array") { originalData[ binding.childDataProperty ] = []; } if (dataIndex === 0) { - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { originalData[ binding.childDataProperty ] = data.concat(originalData[ binding.childDataProperty ]); } else { @@ -3490,7 +3490,7 @@ if (this.options.dataSource.root()._data.length <= this.element.find(".ui-igtree-noderoot").length || this.element.find(".ui-igtree-noderoot").length <= 0) { - if ($.type(data) === "array") { + if ($.ig.util.getType(data) === "array") { for (i = 0; i < data.length; i++) { this.options.dataSource.root()._data.push(data[ i ]); } @@ -3503,7 +3503,7 @@ // K.D. November 14th, 2014 Bug #185180 In some cases the child data prop is an empty object and it should be made an array. if (!originalData.hasOwnProperty(binding.childDataProperty) || - $.type(originalData[ binding.childDataProperty ]) !== "array") { + $.ig.util.getType(originalData[ binding.childDataProperty ]) !== "array") { originalData[ binding.childDataProperty ] = []; } originalData[ binding.childDataProperty ] = diff --git a/src/js/modules/infragistics.ui.upload.js b/src/js/modules/infragistics.ui.upload.js index db6353c88..6e07f5b1a 100644 --- a/src/js/modules/infragistics.ui.upload.js +++ b/src/js/modules/infragistics.ui.upload.js @@ -303,7 +303,7 @@ if (isDisabled === false) { this.isVisibleFilePicker = false; - /* filePicker.removeProp("disabled"); */ + /* filePicker[0].removeAttribute("disabled"); */ this._attachMouseMove(true); /* IE9 fix - unbind mouse over event */ this.element.on(this._internalEvents).mouseover(); @@ -2441,7 +2441,7 @@ currentFileSize = currentFile.size; } - if ($.type(currentFileSize) === "number") { + if ($.ig.util.getType(currentFileSize) === "number") { fileSize += currentFileSize; } @@ -2470,8 +2470,8 @@ self._trigger(self.events.onFormDataSubmit, null, eventArgs); } - if ($.type(o.maxFileSize) === "number" && - $.type(fileSize) === "number" && + if ($.ig.util.getType(o.maxFileSize) === "number" && + $.ig.util.getType(fileSize) === "number" && o.maxFileSize > -1 && fileSize > o.maxFileSize) { self._setError( fileId, @@ -2580,7 +2580,7 @@ $(".selector").igUpload("addDataField", ui.formData, { "name": "Parameter Name", "value": "Value" }); ``` */ - if (!field || $.type(field) !== "object") { + if (!field || $.ig.util.getType(field) !== "object") { return; } this.addDataFields(formData, [ field ]); @@ -2593,7 +2593,7 @@ $(".selector").igUpload("addDataFields", ui.formData, [{ "name": "Parameter Name 1", "value": "Value 1" }, { "name": "Parameter Name 2", "value": "Value 2" }]); ``` */ - if (!formData || $.type(fields) !== "array" || !fields.length) { + if (!formData || $.ig.util.getType(fields) !== "array" || !fields.length) { return; } var i, len = fields.length, f, isHTMLForm; @@ -2605,7 +2605,7 @@ } for (i = 0; i < len; i++) { f = fields[ i ]; - if (!f.name || $.type(f.value) !== "string") { + if (!f.name || $.ig.util.getType(f.value) !== "string") { continue; } if (isHTMLForm) { @@ -3038,8 +3038,8 @@ if (file) { fileSize = file.size; } - if ($.type(o.maxFileSize) === "number" && - $.type(fileSize) === "number" && + if ($.ig.util.getType(o.maxFileSize) === "number" && + $.ig.util.getType(fileSize) === "number" && o.maxFileSize > -1 && fileSize > o.maxFileSize) { self._removeUploadSetError(formNumber, diff --git a/src/js/modules/infragistics.ui.videoplayer.js b/src/js/modules/infragistics.ui.videoplayer.js index ff4de2bea..a6ddfaa26 100644 --- a/src/js/modules/infragistics.ui.videoplayer.js +++ b/src/js/modules/infragistics.ui.videoplayer.js @@ -5242,7 +5242,7 @@ ``` paramType="number" min="0.0" max="1.0" optional="true" Specify scale factor between 0 and 1. returnType="canvasType" Returns HTML5 canvas element that represents the captured screenshot. */ - if (!scaleFactor || $.type(scaleFactor) !== "number") { + if (!scaleFactor || $.ig.util.getType(scaleFactor) !== "number") { scaleFactor = 1; } var videoElem = this.currentVideo[ 0 ], diff --git a/src/js/modules/infragistics.ui.zoombar.js b/src/js/modules/infragistics.ui.zoombar.js index 1bb9d6032..0385f34d0 100644 --- a/src/js/modules/infragistics.ui.zoombar.js +++ b/src/js/modules/infragistics.ui.zoombar.js @@ -1606,7 +1606,7 @@ } }, _windowRectChanged: function (evt, ui) { - if ($.type(this.settings.zoomChangedCallback) === "function") { + if ($.ig.util.getType(this.settings.zoomChangedCallback) === "function") { this.settings.zoomChangedCallback(evt, ui); } }, diff --git a/src/js/modules/infragistics.util.jquery.js b/src/js/modules/infragistics.util.jquery.js index 73164f3ed..71bd0cf7f 100644 --- a/src/js/modules/infragistics.util.jquery.js +++ b/src/js/modules/infragistics.util.jquery.js @@ -128,7 +128,7 @@ if (!reg) { return $.ig.regional.defaults || {}; } - return (($.type(reg) === "string") ? + return (($.ig.util.getType(reg) === "string") ? $.ig.regional[ reg ] : reg) || {}; }; $.ig.getRegionalValue = function (key, reg) { @@ -1036,11 +1036,11 @@ $.ig.util.invokeCallback = function (callback, args) { if (callback) { - if ($.type(callback) === "string" && - window[ callback ] && $.type(window[ callback ]) === "function") { + if ($.ig.util.getType(callback) === "string" && + window[ callback ] && $.ig.util.getType(window[ callback ]) === "function") { callback = window[ callback ]; } - if ($.type(callback) === "function") { + if ($.ig.util.getType(callback) === "function") { callback.apply(window, args); } } @@ -1317,4 +1317,11 @@ $type: new $.ig.Type("jQueryDomRenderer", $.ig.Object.prototype.$type) }, true); + // replaces the deprecated $.type for most common cases + $.ig.util.getType = function (value) { + if (value === null) return "null"; + if (value === undefined) return "undefined"; + return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); + } + }));// REMOVE_FROM_COMBINED_FILES From c36fa30c0f19e76dceb7a66f05680a5365fe7b5c Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Thu, 13 Feb 2025 18:38:38 +0200 Subject: [PATCH 5/6] fix(editors): fixing faulty warning removal --- src/js/modules/infragistics.ui.editors.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/modules/infragistics.ui.editors.js b/src/js/modules/infragistics.ui.editors.js index 7756c75a5..f0a9de345 100644 --- a/src/js/modules/infragistics.ui.editors.js +++ b/src/js/modules/infragistics.ui.editors.js @@ -990,8 +990,8 @@ //Default value we don't do anything unless we implement setOption related to that. this._editorInput.prop("readonly", false); this._valueInput.prop("readonly", false); - this._editorInput[0].removeAttribute("disabled"); - this._valueInput[0].removeAttribute("disabled"); + this._editorInput.prop("disabled", false); + this._valueInput.prop("disabled", false); this._editorContainer.removeClass(this.css.disabled); this._attachEvents(); }, @@ -1001,8 +1001,8 @@ this._valueInput.prop("disabled", true); this._disableEditor(true); } else { - this._editorInput[0].removeAttribute("disabled"); - this._valueInput[0].removeAttribute("disabled"); + this._editorInput.prop("disabled", false); + this._valueInput.prop("disabled", false); if (!this.options.readOnly) { this._setEditableMode(); } @@ -2241,7 +2241,7 @@ if (target && target.attr("disabled")) { target.removeClass(this.css.disabled); target[0].removeAttribute("disabled"); - target[0].removeAttribute("disabled"); + target.prop("disabled", false); this._attachButtonsEvents(type, target); } }, From 281c8e246d7785a3df3b2bc5f0891510fe305647 Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Thu, 13 Feb 2025 18:52:43 +0200 Subject: [PATCH 6/6] chore(*): fixing lint error --- src/js/modules/infragistics.util.jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/modules/infragistics.util.jquery.js b/src/js/modules/infragistics.util.jquery.js index 71bd0cf7f..569a89942 100644 --- a/src/js/modules/infragistics.util.jquery.js +++ b/src/js/modules/infragistics.util.jquery.js @@ -1322,6 +1322,6 @@ if (value === null) return "null"; if (value === undefined) return "undefined"; return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); - } + }; }));// REMOVE_FROM_COMBINED_FILES