Skip to content

fix(*): removing a multitude of deprecated api usage #2275

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/combo/keyboard-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h4 class="combo-label">World's 10 Highest Mountain Peaks</h4>
$("#combo").igCombo("clearInput");
$("#combo").igCombo("closeDropDown");
$('#tooltip').tooltip('open');
$(".ui-igcombo-field").focus();
$(".ui-igcombo-field").trigger("focus");
}

function showMessage(message) {
Expand Down
4 changes: 2 additions & 2 deletions demos/html-editor/api-and-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@
focusAndPrintType = "object"
}
if (typeof document.getElementById("htmlEditor_editor").focus === focusAndPrintType) {
document.getElementById("htmlEditor_editor").focus();
document.getElementById("htmlEditor_editor").trigger("focus");
}
if (typeof document.getElementById("htmlEditor_editor").print === focusAndPrintType) {
document.getElementById("htmlEditor_editor").print();
}
if (typeof document.getElementById("htmlEditor_editor").contentWindow.focus === focusAndPrintType) {
document.getElementById("htmlEditor_editor").contentWindow.focus();
document.getElementById("htmlEditor_editor").contentWindow.trigger("focus");
}
if (typeof document.getElementById("htmlEditor_editor").contentWindow.print === focusAndPrintType) {
document.getElementById("htmlEditor_editor").contentWindow.print();
Expand Down
2 changes: 1 addition & 1 deletion demos/tree/api-and-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
function focusOnMobile() {
setTimeout(function () {
if ($(window).width() < 600) {
$(".api-viewer").focus();
$(".api-viewer").trigger("focus");
}
}, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions demos/tree/bind-tree-with-ko.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
viewModel.SetSelected(parentNode.data);
setTimeout(function () {
if ($(window).width() < 600) {
$("#productEditorsContainer").focus();
$("#productEditorsContainer").trigger("focus");
}
}, 0);
} else {
setTimeout(function () {
if ($(window).width() < 600) {
$("#categoryEditorsContainer").focus();
$("#categoryEditorsContainer").trigger("focus");
}
}, 0);
}
Expand Down
16 changes: 8 additions & 8 deletions src/js/modules/infragistics.datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@
var i,
data = ds || this._data,
len = data ? data.length : 0,
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
for (i = 0; i < len; i++) {
if (data[ i ][ search ] === key) {
return data[ i ];
Expand Down Expand Up @@ -2622,7 +2622,7 @@
while (count < all.length) {
data = all[ count++ ];
len = data ? data.length : 0;
search = len > 0 && $.isArray(data[ 0 ]) ? primeIdx : prime;
search = len > 0 && Array.isArray(data[ 0 ]) ? primeIdx : prime;
for (i = 0; i < len; i++) {
if (data[ i ] && data[ i ][ search ] === key) {
//A.T. 8 March 2012 - Fix for bug #104244
Expand Down Expand Up @@ -9902,7 +9902,7 @@
return [];
}
if ($.ig.util.getType(dataRow) === "object") {
search = data && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
search = data && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
key = dataRow[ search ];
if (key === undefined || key === null) {
return [];
Expand Down Expand Up @@ -11437,7 +11437,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;
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
if ($.ig.util.getType(record) !== "object") {
key = record;
} else {
Expand Down Expand Up @@ -11487,7 +11487,7 @@
data = ds || this._data,
len = data ? data.length : 0,
dsLayoutKey = this.settings.treeDS.childDataKey,
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
objPath = objPath || { path: "", parentRows: [] };
objPath.parentRows = objPath.parentRows || [];
objPath.path = objPath.path || "";
Expand Down Expand Up @@ -11555,12 +11555,12 @@
}
},
_removeRecordInFlatDs: function (data, key, fk) {
if (!data || !$.isArray(data) || !data.length ||
if (!data || !Array.isArray(data) || !data.length ||
(key === undefined && fk === undefined)) {
return;
}
var i, prime = this.settings.primaryKey, tmp,
pkSearch = $.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
pkSearch = Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
fkSearch = this.settings.treeDS.foreignKey;
for (i = 0; i < data.length; i++) {
if (data[ i ]) {
Expand All @@ -11583,7 +11583,7 @@
}
var i, prime = this.settings.primaryKey,
len = data ? data.length : 0,
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
layoutKey = this.settings.treeDS.childDataKey,
layoutData = [],
found = false;
Expand Down
10 changes: 5 additions & 5 deletions src/js/modules/infragistics.ui.combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@
lod = options.loadOnDemandSettings;

if (this.options.dataSource) {
if ($.isArray(this.options.dataSource)) {
if (Array.isArray(this.options.dataSource)) {
firstDataItem = this.options.dataSource[ 0 ];
} else if (this.options.dataSource &&
typeof this.options.dataSource._xmlToArray === "function" &&
Expand Down Expand Up @@ -2983,7 +2983,7 @@
$(input).is(":visible") && !readonly) {
range = input.createTextRange();
range.collapse(false);
range.select();
range.trigger("select");
}

// Reapply readonly attribute
Expand Down Expand Up @@ -3480,7 +3480,7 @@
selRange.collapse(true);
selRange.moveStart("character", start);
selRange.moveEnd("character", end);
selRange.select();
selRange.trigger("select");
field.focus();
} else if (field.setSelectionRange) {
field.focus();
Expand Down Expand Up @@ -4126,8 +4126,8 @@
} else {

// Trigger focus handler to reset the flags
// $().focus() is not recommended when input is not focused, because it triggers focus handler twice in IE
$input.focus();
// $().trigger("focus") is not recommended when input is not focused, because it triggers focus handler twice in IE
$input.trigger("focus");
}
},
_windowResize: function () {
Expand Down
12 changes: 6 additions & 6 deletions src/js/modules/infragistics.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
return elem && src && (elem.has(src).length > 0 || elem[ 0 ] === src);
},
_notab = function (elem) {
return elem.attr("zIndex", -1).css("outline", 0).attr("unselectable", "on");
return elem.attr("zIndex", -1).css("outline", "none").attr("unselectable", "on");
},
_toPx = function (elem, css) {

Expand Down Expand Up @@ -1030,8 +1030,8 @@
elem0 = $("<div />");
this.element.contents().appendTo(elem0);
el = elem = this.element;
elem.css({ zIndex: o.zIndex || 1000, outline: 0 }).attr("tabIndex", o.tabIndex)
.keydown(function (e) {
elem.css({ zIndex: o.zIndex || 1000, outline: "none" }).attr("tabIndex", o.tabIndex)
.on("keydown", function (e) {
if (o.closeOnEscape && e.keyCode === $.ui.keyCode.ESCAPE) {
self.close(e);
e.preventDefault();
Expand Down Expand Up @@ -1103,7 +1103,7 @@
try { el.focus(); } catch (ex) { }
}
})
.mousedown(function (e) { self.moveToTop(e); });
.on("mousedown", function (e) { self.moveToTop(e); });
el.addClass(css.dialog);
if (o.dialogClass) {
el.addClass(o.dialogClass);
Expand Down Expand Up @@ -1602,7 +1602,7 @@
}
delete self._minHW;
header = self._header = _notab($("<div />").addClass(css.header).css("display", "block")
.prependTo(self.element)).dblclick(function (e) {
.prependTo(self.element)).on("dblclick", function (e) {
var dbl = o.enableDblclick;
if (!dbl) {
return;
Expand Down Expand Up @@ -2621,7 +2621,7 @@
self._modalDiv = div = _notab($("<div />").css({
position: "fixed", left: 0, top: 0, bottom: 0, right: 0, zIndex: _maxZ - 1
})
.addClass(self.css.overlay).mousedown(function (e) {
.addClass(self.css.overlay).on("mousedown", function (e) {
self._setFocus();
_stopEvt(e);
})
Expand Down
28 changes: 14 additions & 14 deletions src/js/modules/infragistics.ui.editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@
_setBlur: function (event) { //Base Editor
var newValue;
if (this._cancelBlurOnInput) {
this._editorInput.focus();
this._editorInput.trigger("focus");
delete this._cancelBlurOnInput;
} else {
this._triggerBlur(event);
Expand Down Expand Up @@ -3559,7 +3559,7 @@
// Proceed with hiding
// D.P. 21 Jun 2016 Bug 220712: igTextEditor - typed text is reverted to previous value in case the drop down is opened
if (!this._editMode && !this.options.suppressKeyboard) {
this._editorInput.focus();
this._editorInput.trigger("focus");
}
if (this._editMode && this.options.suppressKeyboard) {
this._editorInput.blur();
Expand Down Expand Up @@ -3640,7 +3640,7 @@
range.collapse(true);
range.moveEnd("character", selectionEnd);
range.moveStart("character", selectionStart);
range.select();
range.trigger("select");
}
},
_positionCursor: function (startPosition, endPosition) {
Expand All @@ -3660,7 +3660,7 @@
currentValue.length);
}, 100));
} else {
this._editorInput.select();
this._editorInput.trigger("select");
}
}
break;
Expand Down Expand Up @@ -3718,7 +3718,7 @@
currentValue.length);
}, 100));
} else {
this._editorInput.select();
this._editorInput.trigger("select");
}
}
}
Expand All @@ -3727,7 +3727,7 @@
break;
}
} else {
this._editorInput.select();
this._editorInput.trigger("select");
}
},
_carryOverNewLine: function(value) {
Expand Down Expand Up @@ -3758,7 +3758,7 @@
if (this._editMode) {
this._editorInput.val(nextItem.text());
this._processTextChanged();
this._editorInput.select();
this._editorInput.trigger("select");
} else {
this._processValueChanging(nextItem.text());
this._editorInput.val(this._getDisplayValue());
Expand Down Expand Up @@ -5828,7 +5828,7 @@
} else {
this._spinUp();
if (this._focused) {
this._editorInput.select();
this._editorInput.trigger("select");
}
}
},
Expand All @@ -5839,7 +5839,7 @@
} else {
this._spinDown();
if (this._focused) {
this._editorInput.select();
this._editorInput.trigger("select");
}
}
},
Expand Down Expand Up @@ -7381,7 +7381,7 @@
}
if (result === false && this._editSelectAllStarted) {
this._editorInput.val(this._editorValueBeforeClear);
this._editorInput.select();
this._editorInput.trigger("select");
delete this._editSelectAllStarted;
delete this._editorValueBeforeClear;
}
Expand Down Expand Up @@ -8911,7 +8911,7 @@
_setBlur: function (event) { //DateEditor
var newValue, oldVal, convertedDate;
if (this._cancelBlurOnInput) {
this._editorInput.focus();
this._editorInput.trigger("focus");
delete this._cancelBlurOnInput;
} else {
this._triggerBlur(event);
Expand Down Expand Up @@ -11080,7 +11080,7 @@
} else {
self._focused = false;
if (!self.options.suppressKeyboard) {
self._editorInput.focus();
self._editorInput.trigger("focus");
}
}
},
Expand Down Expand Up @@ -12109,12 +12109,12 @@
if (delay) {
this._timeouts.push(setTimeout(function () {
self._cancelFocusTrigger = true;
self._editorContainer.focus();
self._editorContainer.trigger("focus");
self._setFocus();
}, delay));
} else {
this._cancelFocusTrigger = true;
this._editorContainer.focus();
this._editorContainer.trigger("focus");
this._setFocus();
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/js/modules/infragistics.ui.htmleditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2379,8 +2379,8 @@

// D.A. 25th November 2013, Bug #158403 ExecuteAction method ignores the current selection.
// The select() call resets the selection.
//this._selectionWrapperSaved.focus();
//this._selectionWrapperSaved.select();
//this._selectionWrapperSaved.trigger("focus");
//this._selectionWrapperSaved.trigger("select");
this._selectionWrapperSaved.execCommand(actionName.toLowerCase(), args);
this._onSelectionChange();
},
Expand Down Expand Up @@ -2761,7 +2761,7 @@
}
});
this.element.on("igpopovershown", function () {
self.poContent.find("#" + self._id("_linkHref")).focus();
self.poContent.find("#" + self._id("_linkHref")).trigger("focus");
});
},
_createForm: function () {
Expand Down
Loading