Skip to content

Commit 940e46a

Browse files
authored
Merge pull request #2275 from IgniteUI/sstoychev/more-deprecation-removals
fix(*): removing a multitude of deprecated api usage
2 parents d26de79 + df3cba1 commit 940e46a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+309
-309
lines changed

demos/combo/keyboard-navigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ <h4 class="combo-label">World's 10 Highest Mountain Peaks</h4>
126126
$("#combo").igCombo("clearInput");
127127
$("#combo").igCombo("closeDropDown");
128128
$('#tooltip').tooltip('open');
129-
$(".ui-igcombo-field").focus();
129+
$(".ui-igcombo-field").trigger("focus");
130130
}
131131

132132
function showMessage(message) {

demos/html-editor/api-and-events.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@
164164
focusAndPrintType = "object"
165165
}
166166
if (typeof document.getElementById("htmlEditor_editor").focus === focusAndPrintType) {
167-
document.getElementById("htmlEditor_editor").focus();
167+
document.getElementById("htmlEditor_editor").trigger("focus");
168168
}
169169
if (typeof document.getElementById("htmlEditor_editor").print === focusAndPrintType) {
170170
document.getElementById("htmlEditor_editor").print();
171171
}
172172
if (typeof document.getElementById("htmlEditor_editor").contentWindow.focus === focusAndPrintType) {
173-
document.getElementById("htmlEditor_editor").contentWindow.focus();
173+
document.getElementById("htmlEditor_editor").contentWindow.trigger("focus");
174174
}
175175
if (typeof document.getElementById("htmlEditor_editor").contentWindow.print === focusAndPrintType) {
176176
document.getElementById("htmlEditor_editor").contentWindow.print();

demos/tree/api-and-events.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
function focusOnMobile() {
135135
setTimeout(function () {
136136
if ($(window).width() < 600) {
137-
$(".api-viewer").focus();
137+
$(".api-viewer").trigger("focus");
138138
}
139139
}, 0);
140140
}

demos/tree/bind-tree-with-ko.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@
101101
viewModel.SetSelected(parentNode.data);
102102
setTimeout(function () {
103103
if ($(window).width() < 600) {
104-
$("#productEditorsContainer").focus();
104+
$("#productEditorsContainer").trigger("focus");
105105
}
106106
}, 0);
107107
} else {
108108
setTimeout(function () {
109109
if ($(window).width() < 600) {
110-
$("#categoryEditorsContainer").focus();
110+
$("#categoryEditorsContainer").trigger("focus");
111111
}
112112
}, 0);
113113
}

src/js/modules/infragistics.datasource.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@
25642564
var i,
25652565
data = ds || this._data,
25662566
len = data ? data.length : 0,
2567-
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
2567+
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
25682568
for (i = 0; i < len; i++) {
25692569
if (data[ i ][ search ] === key) {
25702570
return data[ i ];
@@ -2622,7 +2622,7 @@
26222622
while (count < all.length) {
26232623
data = all[ count++ ];
26242624
len = data ? data.length : 0;
2625-
search = len > 0 && $.isArray(data[ 0 ]) ? primeIdx : prime;
2625+
search = len > 0 && Array.isArray(data[ 0 ]) ? primeIdx : prime;
26262626
for (i = 0; i < len; i++) {
26272627
if (data[ i ] && data[ i ][ search ] === key) {
26282628
//A.T. 8 March 2012 - Fix for bug #104244
@@ -9902,7 +9902,7 @@
99029902
return [];
99039903
}
99049904
if ($.ig.util.getType(dataRow) === "object") {
9905-
search = data && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
9905+
search = data && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
99069906
key = dataRow[ search ];
99079907
if (key === undefined || key === null) {
99089908
return [];
@@ -11437,7 +11437,7 @@
1143711437
}
1143811438
var data = this._data, resRecord, search, key, objPath = { path: "" },
1143911439
path, len = data ? data.length : 0;
11440-
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
11440+
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
1144111441
if ($.ig.util.getType(record) !== "object") {
1144211442
key = record;
1144311443
} else {
@@ -11487,7 +11487,7 @@
1148711487
data = ds || this._data,
1148811488
len = data ? data.length : 0,
1148911489
dsLayoutKey = this.settings.treeDS.childDataKey,
11490-
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
11490+
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : this.settings.primaryKey;
1149111491
objPath = objPath || { path: "", parentRows: [] };
1149211492
objPath.parentRows = objPath.parentRows || [];
1149311493
objPath.path = objPath.path || "";
@@ -11555,12 +11555,12 @@
1155511555
}
1155611556
},
1155711557
_removeRecordInFlatDs: function (data, key, fk) {
11558-
if (!data || !$.isArray(data) || !data.length ||
11558+
if (!data || !Array.isArray(data) || !data.length ||
1155911559
(key === undefined && fk === undefined)) {
1156011560
return;
1156111561
}
1156211562
var i, prime = this.settings.primaryKey, tmp,
11563-
pkSearch = $.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
11563+
pkSearch = Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
1156411564
fkSearch = this.settings.treeDS.foreignKey;
1156511565
for (i = 0; i < data.length; i++) {
1156611566
if (data[ i ]) {
@@ -11583,7 +11583,7 @@
1158311583
}
1158411584
var i, prime = this.settings.primaryKey,
1158511585
len = data ? data.length : 0,
11586-
search = len > 0 && $.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
11586+
search = len > 0 && Array.isArray(data[ 0 ]) ? this._lookupPkIndex() : prime,
1158711587
layoutKey = this.settings.treeDS.childDataKey,
1158811588
layoutData = [],
1158911589
found = false;

src/js/modules/infragistics.ui.combo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@
16761676
lod = options.loadOnDemandSettings;
16771677

16781678
if (this.options.dataSource) {
1679-
if ($.isArray(this.options.dataSource)) {
1679+
if (Array.isArray(this.options.dataSource)) {
16801680
firstDataItem = this.options.dataSource[ 0 ];
16811681
} else if (this.options.dataSource &&
16821682
typeof this.options.dataSource._xmlToArray === "function" &&
@@ -2983,7 +2983,7 @@
29832983
$(input).is(":visible") && !readonly) {
29842984
range = input.createTextRange();
29852985
range.collapse(false);
2986-
range.select();
2986+
range.trigger("select");
29872987
}
29882988

29892989
// Reapply readonly attribute
@@ -3480,7 +3480,7 @@
34803480
selRange.collapse(true);
34813481
selRange.moveStart("character", start);
34823482
selRange.moveEnd("character", end);
3483-
selRange.select();
3483+
selRange.trigger("select");
34843484
field.focus();
34853485
} else if (field.setSelectionRange) {
34863486
field.focus();
@@ -4126,8 +4126,8 @@
41264126
} else {
41274127

41284128
// Trigger focus handler to reset the flags
4129-
// $().focus() is not recommended when input is not focused, because it triggers focus handler twice in IE
4130-
$input.focus();
4129+
// $().trigger("focus") is not recommended when input is not focused, because it triggers focus handler twice in IE
4130+
$input.trigger("focus");
41314131
}
41324132
},
41334133
_windowResize: function () {

src/js/modules/infragistics.ui.dialog.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
return elem && src && (elem.has(src).length > 0 || elem[ 0 ] === src);
8080
},
8181
_notab = function (elem) {
82-
return elem.attr("zIndex", -1).css("outline", 0).attr("unselectable", "on");
82+
return elem.attr("zIndex", -1).css("outline", "none").attr("unselectable", "on");
8383
},
8484
_toPx = function (elem, css) {
8585

@@ -1030,8 +1030,8 @@
10301030
elem0 = $("<div />");
10311031
this.element.contents().appendTo(elem0);
10321032
el = elem = this.element;
1033-
elem.css({ zIndex: o.zIndex || 1000, outline: 0 }).attr("tabIndex", o.tabIndex)
1034-
.keydown(function (e) {
1033+
elem.css({ zIndex: o.zIndex || 1000, outline: "none" }).attr("tabIndex", o.tabIndex)
1034+
.on("keydown", function (e) {
10351035
if (o.closeOnEscape && e.keyCode === $.ui.keyCode.ESCAPE) {
10361036
self.close(e);
10371037
e.preventDefault();
@@ -1103,7 +1103,7 @@
11031103
try { el.focus(); } catch (ex) { }
11041104
}
11051105
})
1106-
.mousedown(function (e) { self.moveToTop(e); });
1106+
.on("mousedown", function (e) { self.moveToTop(e); });
11071107
el.addClass(css.dialog);
11081108
if (o.dialogClass) {
11091109
el.addClass(o.dialogClass);
@@ -1602,7 +1602,7 @@
16021602
}
16031603
delete self._minHW;
16041604
header = self._header = _notab($("<div />").addClass(css.header).css("display", "block")
1605-
.prependTo(self.element)).dblclick(function (e) {
1605+
.prependTo(self.element)).on("dblclick", function (e) {
16061606
var dbl = o.enableDblclick;
16071607
if (!dbl) {
16081608
return;
@@ -2621,7 +2621,7 @@
26212621
self._modalDiv = div = _notab($("<div />").css({
26222622
position: "fixed", left: 0, top: 0, bottom: 0, right: 0, zIndex: _maxZ - 1
26232623
})
2624-
.addClass(self.css.overlay).mousedown(function (e) {
2624+
.addClass(self.css.overlay).on("mousedown", function (e) {
26252625
self._setFocus();
26262626
_stopEvt(e);
26272627
})

src/js/modules/infragistics.ui.editors.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@
10611061
_setBlur: function (event) { //Base Editor
10621062
var newValue;
10631063
if (this._cancelBlurOnInput) {
1064-
this._editorInput.focus();
1064+
this._editorInput.trigger("focus");
10651065
delete this._cancelBlurOnInput;
10661066
} else {
10671067
this._triggerBlur(event);
@@ -3559,7 +3559,7 @@
35593559
// Proceed with hiding
35603560
// D.P. 21 Jun 2016 Bug 220712: igTextEditor - typed text is reverted to previous value in case the drop down is opened
35613561
if (!this._editMode && !this.options.suppressKeyboard) {
3562-
this._editorInput.focus();
3562+
this._editorInput.trigger("focus");
35633563
}
35643564
if (this._editMode && this.options.suppressKeyboard) {
35653565
this._editorInput.blur();
@@ -3640,7 +3640,7 @@
36403640
range.collapse(true);
36413641
range.moveEnd("character", selectionEnd);
36423642
range.moveStart("character", selectionStart);
3643-
range.select();
3643+
range.trigger("select");
36443644
}
36453645
},
36463646
_positionCursor: function (startPosition, endPosition) {
@@ -3660,7 +3660,7 @@
36603660
currentValue.length);
36613661
}, 100));
36623662
} else {
3663-
this._editorInput.select();
3663+
this._editorInput.trigger("select");
36643664
}
36653665
}
36663666
break;
@@ -3718,7 +3718,7 @@
37183718
currentValue.length);
37193719
}, 100));
37203720
} else {
3721-
this._editorInput.select();
3721+
this._editorInput.trigger("select");
37223722
}
37233723
}
37243724
}
@@ -3727,7 +3727,7 @@
37273727
break;
37283728
}
37293729
} else {
3730-
this._editorInput.select();
3730+
this._editorInput.trigger("select");
37313731
}
37323732
},
37333733
_carryOverNewLine: function(value) {
@@ -3758,7 +3758,7 @@
37583758
if (this._editMode) {
37593759
this._editorInput.val(nextItem.text());
37603760
this._processTextChanged();
3761-
this._editorInput.select();
3761+
this._editorInput.trigger("select");
37623762
} else {
37633763
this._processValueChanging(nextItem.text());
37643764
this._editorInput.val(this._getDisplayValue());
@@ -5828,7 +5828,7 @@
58285828
} else {
58295829
this._spinUp();
58305830
if (this._focused) {
5831-
this._editorInput.select();
5831+
this._editorInput.trigger("select");
58325832
}
58335833
}
58345834
},
@@ -5839,7 +5839,7 @@
58395839
} else {
58405840
this._spinDown();
58415841
if (this._focused) {
5842-
this._editorInput.select();
5842+
this._editorInput.trigger("select");
58435843
}
58445844
}
58455845
},
@@ -7381,7 +7381,7 @@
73817381
}
73827382
if (result === false && this._editSelectAllStarted) {
73837383
this._editorInput.val(this._editorValueBeforeClear);
7384-
this._editorInput.select();
7384+
this._editorInput.trigger("select");
73857385
delete this._editSelectAllStarted;
73867386
delete this._editorValueBeforeClear;
73877387
}
@@ -8911,7 +8911,7 @@
89118911
_setBlur: function (event) { //DateEditor
89128912
var newValue, oldVal, convertedDate;
89138913
if (this._cancelBlurOnInput) {
8914-
this._editorInput.focus();
8914+
this._editorInput.trigger("focus");
89158915
delete this._cancelBlurOnInput;
89168916
} else {
89178917
this._triggerBlur(event);
@@ -11080,7 +11080,7 @@
1108011080
} else {
1108111081
self._focused = false;
1108211082
if (!self.options.suppressKeyboard) {
11083-
self._editorInput.focus();
11083+
self._editorInput.trigger("focus");
1108411084
}
1108511085
}
1108611086
},
@@ -12109,12 +12109,12 @@
1210912109
if (delay) {
1211012110
this._timeouts.push(setTimeout(function () {
1211112111
self._cancelFocusTrigger = true;
12112-
self._editorContainer.focus();
12112+
self._editorContainer.trigger("focus");
1211312113
self._setFocus();
1211412114
}, delay));
1211512115
} else {
1211612116
this._cancelFocusTrigger = true;
12117-
this._editorContainer.focus();
12117+
this._editorContainer.trigger("focus");
1211812118
this._setFocus();
1211912119
}
1212012120
},

src/js/modules/infragistics.ui.htmleditor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,8 +2379,8 @@
23792379

23802380
// D.A. 25th November 2013, Bug #158403 ExecuteAction method ignores the current selection.
23812381
// The select() call resets the selection.
2382-
//this._selectionWrapperSaved.focus();
2383-
//this._selectionWrapperSaved.select();
2382+
//this._selectionWrapperSaved.trigger("focus");
2383+
//this._selectionWrapperSaved.trigger("select");
23842384
this._selectionWrapperSaved.execCommand(actionName.toLowerCase(), args);
23852385
this._onSelectionChange();
23862386
},
@@ -2761,7 +2761,7 @@
27612761
}
27622762
});
27632763
this.element.on("igpopovershown", function () {
2764-
self.poContent.find("#" + self._id("_linkHref")).focus();
2764+
self.poContent.find("#" + self._id("_linkHref")).trigger("focus");
27652765
});
27662766
},
27672767
_createForm: function () {

0 commit comments

Comments
 (0)