Skip to content

Commit 1e0020c

Browse files
committed
fix(*): changing previous replace with the util func
1 parent 281c8e2 commit 1e0020c

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

demos/combo/load-on-demand.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
// Helper function to put an item data token to the selected item table utilizing a jQuery template
5555
var selectedItemTemplate = '<tr><td class="propName">${propertyName}</td><td class="propValue">${propertyValue}</td></tr>';
5656
function addItemValue(tableObject, item, itemProp) {
57-
if (typeof item[itemProp] !== "function") {
57+
if ($.ig.util.getType(item[itemProp]) !== "function") {
5858
$($.ig.tmpl(selectedItemTemplate,
5959
{
6060
"propertyName": itemProp,

src/js/modules/infragistics.datasource.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3993,7 +3993,7 @@
39933993
/* fire the data binding event */
39943994
args = { cancel: false };
39953995

3996-
if (typeof p.dataBinding === "function") {
3996+
if ($.ig.util.getType(p.dataBinding) === "function") {
39973997
noCancel = p.dataBinding(this, args);
39983998
if (noCancel === undefined) {
39993999
noCancel = true;
@@ -4256,7 +4256,7 @@
42564256
},
42574257
_internalDataBound: function (callDatabound) {
42584258
// M.H. 18 Aug 2014 Fix for bug #177147: The dataBound event is called before the JSON file is returned
4259-
if (callDatabound && typeof this.settings.dataBound === "function") {
4259+
if (callDatabound && $.ig.util.getType(this.settings.dataBound) === "function") {
42604260
this.settings.dataBound(this);
42614261
}
42624262
},
@@ -4827,7 +4827,7 @@
48274827
"extraParams": extraParams,
48284828
"pkParams": pkParams
48294829
};
4830-
if (typeof props.urlParamsEncoding === "function") {
4830+
if ($.ig.util.getType(props.urlParamsEncoding) === "function") {
48314831
//args = props.urlParamsEncoding(this, params);
48324832
noCancel = props.urlParamsEncoding(this, params);
48334833
}
@@ -4847,7 +4847,7 @@
48474847
this.settings.encodeExtraParams(this, params);
48484848
}
48494849

4850-
if (typeof props.urlParamsEncoded === "function") {
4850+
if ($.ig.util.getType(props.urlParamsEncoded) === "function") {
48514851
props.urlParamsEncoded(this, params);
48524852
}
48534853
}
@@ -5661,7 +5661,7 @@
56615661
direction = "";
56625662
}
56635663
/* check if a custom conversion function is set */
5664-
if (typeof s.customConvertFunc === "function") {
5664+
if ($.ig.util.getType(s.customConvertFunc) === "function") {
56655665
convertFunc = s.customConvertFunc;
56665666
}
56675667
/*else {
@@ -10967,7 +10967,7 @@
1096710967
};
1096810968
}
1096910969
/* check if a custom conversion function is set */
10970-
if (typeof s.customConvertFunc === "function") {
10970+
if ($.ig.util.getType(s.customConvertFunc) === "function") {
1097110971
convertFunc = s.customConvertFunc;
1097210972
}
1097310973
/* else {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5131,6 +5131,7 @@
51315131
options = this.options,
51325132
isStringDataSource = $.ig.util.getType(options.dataSource) === "string",
51335133
url = options.dataSourceUrl;
5134+
dataSourceType = $.ig.util.getType(options.dataSource);
51345135

51355136
// Set the data source that should be used
51365137
if (!options.dataSource && this.element.is("select")) {
@@ -5144,7 +5145,7 @@
51445145
}
51455146

51465147
// P.P. 29-June-2015 Bug #201942: We need to unwrap the data here, because of the following logic.
5147-
if ($.ig.util.getType(options.dataSource) === "function") {
5148+
if (dataSourceType === "function") {
51485149
options.dataSource = options.dataSource();
51495150
}
51505151

@@ -5156,8 +5157,8 @@
51565157
this._convertToArrayOfObjects(options);
51575158

51585159
// Analyze the schema only when the data source is array or function
5159-
if (!schema && options.dataSource && ($.isArray(options.dataSource) ||
5160-
typeof options.dataSource === "function")) {
5160+
if (!schema && options.dataSource && (dataSourceType === "array" ||
5161+
dataSourceType === "function")) {
51615162

51625163
// N.A. 5/18/2015 Bug #193129: Unwrap before extracting the schema from the first field element.
51635164
schema = this._initSchema(this._unwrapData(options.dataSource)[ 0 ]);
@@ -5208,7 +5209,7 @@
52085209
}
52095210

52105211
// S.T. Feb 24th, 2015 Bug #189447: Handle when data source is JSONP.
5211-
if ($.ig.util.getType(options.dataSource) === "string" &&
5212+
if (dataSourceType === "string" &&
52125213
!options.dataSourceType &&
52135214
$.ig.util.isJsonpUrl(options.dataSource)) {
52145215

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,7 +3158,7 @@
31583158
// and select formatting option, the text on the whole row gets updated
31593159
self._selectClosestTextNode();
31603160

3161-
if (typeof callback === "function") {
3161+
if ($.ig.util.getType(callback) === "function") {
31623162
callback.call(self);
31633163
}
31643164
},
@@ -3349,9 +3349,9 @@
33493349
}
33503350
}
33513351

3352-
if (typeof customCommand === "function" && browser === null) {
3352+
if ($.ig.util.getType(customCommand) === "function" && browser === null) {
33533353
customCommand.call(this, name, args);
3354-
} else if (typeof customCommand === "function" && isCommandSupported) {
3354+
} else if ($.ig.util.getType(customCommand) === "function" && isCommandSupported) {
33553355
customCommand.apply(this, customCommandArgs);
33563356
} else {
33573357
this._document.execCommand(name, false, args);
@@ -3670,8 +3670,8 @@
36703670

36713671
$.each(this._callbackMap, function (isTrueFunc, callback) {
36723672
var isTrueRes = self[ isTrueFunc ](el);
3673-
if (typeof self[ isTrueFunc ] === "function" && isTrueRes &&
3674-
typeof self[ callback ] === "function") {
3673+
if ($.ig.util.getType(self[ isTrueFunc ]) === "function" && isTrueRes &&
3674+
$.ig.util.getType(self[ callback ]) === "function") {
36753675
self[ callback ](el, isTrueRes);
36763676

36773677
// Bug #184142 In IE justify left button is not active by default

src/js/modules/infragistics.ui.toolbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
return this.settings.localeProperties;
8181
},
8282
callbackRenderer: function () {
83-
if (this.settings.callbackRenderer && typeof this.settings.callbackRenderer === "function") {
83+
if (this.settings.callbackRenderer && $.ig.util.getType(this.settings.callbackRenderer) === "function") {
8484
return this.settings.callbackRenderer();
8585
}
8686
},
@@ -945,7 +945,7 @@
945945
},
946946
tbItemsPropsTraversing = function (key, property) {
947947
var scope = o.items[ i ].scope || self;
948-
if (property.action !== undefined && typeof scope[ property.action ] === "function") {
948+
if (property.action !== undefined && $.ig.util.getType(scope[ property.action ]) === "function") {
949949
scope[ property.action ](newItem, property, itemProps);
950950
return;
951951
}

src/js/modules/infragistics.util.jquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@
12211221
var beforeSend = function (jqXHR, options) {
12221222
if (requestOptions) {
12231223

1224-
if (typeof requestOptions.beforeSend === "function") {
1224+
if ($.ig.util.getType(requestOptions.beforeSend) === "function") {
12251225
jqXHR.setRequestHeader("Content-Type", contentType);
12261226
requestOptions.beforeSend.call(this, jqXHR, options, requestOptions);
12271227
}

tests/unit/htmleditor/basicfunctionalities/rendering/htmleditor-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ QUnit.module("igHTMLEditor unit tests", {
183183
buttonCombinationsTest: function () {
184184
var i, buttonsNames = arguments;
185185
for (i = 0; i < buttonsNames.length; i++) {
186-
if (typeof this[buttonsNames[i]] === "function") {
186+
if ($.ig.util.getType(this[buttonsNames[i]]) === "function") {
187187
this[buttonsNames[i]]();
188188
}
189189
}
@@ -355,7 +355,7 @@ QUnit.module("igHTMLEditor unit tests", {
355355
self.htmlEditor.igHtmlEditor('executeAction', actionName, param);
356356

357357
var condition = false;
358-
if (typeof conditionCallBack === "function") {
358+
if ($.ig.util.getType(conditionCallBack) === "function") {
359359
condition = conditionCallBack.call(p, self.editorBody);
360360
}
361361
self.assert.ok(condition, 'Execute action ' + actionName + " combo.");
@@ -383,7 +383,7 @@ QUnit.module("igHTMLEditor unit tests", {
383383
self.htmlEditor.data("igHtmlEditor")._selectionWrapperSaved.select(p.contents());
384384
button.trigger("click");
385385
var condition = false;
386-
if (typeof conditionCallBack === "function") {
386+
if ($.ig.util.getType(conditionCallBack) === "function") {
387387
condition = conditionCallBack.call(p, self.editorBody);
388388
}
389389
self.assert.ok(condition, buttonName + " combo.");
@@ -415,7 +415,7 @@ QUnit.module("igHTMLEditor unit tests", {
415415
return $.ig.TestUtil.wait(200);
416416
}).then(function () {
417417
var condition = false;
418-
if (typeof conditionCallBack === "function") {
418+
if ($.ig.util.getType(conditionCallBack) === "function") {
419419
condition = conditionCallBack.call(p, self.editorBody);
420420
}
421421
combo.igCombo("closeDropDown");

0 commit comments

Comments
 (0)