Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kdinev committed Jun 22, 2017
1 parent 2d65b94 commit bcfc6cf
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 80 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.insertSpaces": false
}
20 changes: 10 additions & 10 deletions build/packages/combined-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ module.exports = {
},
dest: "./dist/js/infragistics.core-lite.js",
src: [
"./dist/js/i18n/infragistics-en.js",
"./dist/js/modules/infragistics.util.js",
"./dist/js/modules/infragistics.util.jquery.js",
"./dist/js/modules/infragistics.util.jquerydeferred.js",
"./dist/js/modules/infragistics.datasource.js",
"./dist/js/modules/infragistics.templating.js",
"./dist/js/modules/infragistics.ui.widget.js",
"./dist/js/modules/infragistics.ui.shared.js",
"./dist/js/modules/infragistics.ui.scroll.js"
]
"./dist/js/i18n/infragistics-en.js",
"./dist/js/modules/infragistics.util.js",
"./dist/js/modules/infragistics.util.jquery.js",
"./dist/js/modules/infragistics.util.jquerydeferred.js",
"./dist/js/modules/infragistics.datasource.js",
"./dist/js/modules/infragistics.templating.js",
"./dist/js/modules/infragistics.ui.widget.js",
"./dist/js/modules/infragistics.ui.shared.js",
"./dist/js/modules/infragistics.ui.scroll.js"
]
},
lob: {
options: {
Expand Down
1 change: 0 additions & 1 deletion src/js/infragistics.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ $.ig.dependencies = [
{
widget: "igCombo",
dependency: [
{ name: "igWidget" },
{ name: "igWidget" },
{ name: "igDataSource" },
{ name: "igTemplating" },
Expand Down
17 changes: 7 additions & 10 deletions src/js/modules/infragistics.ui.combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.dataSource.js
* infragistics.ui.widget.js
*
* Example to use:
* <script type="text/javascript">
Expand All @@ -28,10 +29,6 @@

// AMD. Register as an anonymous module.
define( [
"jquery",
"jquery-ui",
"./infragistics.util",
"./infragistics.util.jquery",
"./infragistics.ui.widget",
"./infragistics.templating",
"./infragistics.datasource",
Expand Down Expand Up @@ -1620,15 +1617,15 @@
inputInput: $.proxy(this._inputInputHandler, this)
};

this._analyzeOptions();
this._analyzeOptions();

// Options related to localization
this._changeLocale();
this._analyzeInitialElem();
this._render();
this.validator();
this._attachEvents();
this.dataBind();
this._analyzeInitialElem();
this._render();
this.validator();
this._attachEvents();
this.dataBind();

// P.P 07-Mar-2016 #212238: Incorrect confirmation of Japanese symbols using IME
this._initCompositionObject();
Expand Down
6 changes: 2 additions & 4 deletions src/js/modules/infragistics.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* jquery.ui.resizable.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.widget.js
*
* Example to use:
* <script type="text/javascript">
* $(function () {
Expand All @@ -29,10 +31,6 @@

// AMD. Register as an anonymous module.
define( [
"jquery",
"jquery-ui",
"./infragistics.util",
"./infragistics.util.jquery",
"./infragistics.ui.widget"
], factory );
} else {
Expand Down
31 changes: 7 additions & 24 deletions src/js/modules/infragistics.ui.editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* jquery.ui-1.9.0.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.widget.js
* infragistics.ui.scroll.js
* infragistics.ui.validator.js
*/
Expand All @@ -19,10 +20,7 @@

// AMD. Register as an anonymous module.
define( [
"jquery",
"jquery-ui",
"./infragistics.util",
"./infragistics.util.jquery",
"./infragistics.ui.widget",
"./infragistics.ui.scroll",
"./infragistics.ui.validator"
], factory );
Expand Down Expand Up @@ -4519,7 +4517,8 @@
if (delta % 1 !== 0) {
fractional = delta.toString().substring(delta.toString().indexOf(".") + 1);
if (fractional.toString().length > this.options.maxDecimals) {
throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaContainsExceedsMaxDecimals"),
throw new Error($.ig.util.stringFormat(
this._getLocaleValue("spinDeltaContainsExceedsMaxDecimals"),
this.options.maxDecimals));
}
}
Expand Down Expand Up @@ -5179,7 +5178,7 @@

// Raise Warning level 2
this._sendNotification("warning",
$.ig.util.stringFormat(this._getLocaleValue("maxValExceedSetErrMsg"),
$.ig.util.stringFormat(this._getLocaleValue("minValExceedSetErrMsg"),
this.options.minValue));
}

Expand Down Expand Up @@ -5249,22 +5248,6 @@
this._updateValue(newValue);
}
},
_getRegionalOption: function (key) {
var regional = this.options.regional;
if (this.options[ key ]) {
return this.options[ key ];
}
if (typeof regional === "string") {
regional = $.ig.regional[ regional ];
}
if (regional && regional[ key ]) {
return regional[ key ];
} else {

// return defaults
return $.ig.regional.defaults[ key ];
}
},
_convertScientificToNumeric: function (num) {
var stringValue = num.toString(),
scientificPrecision = stringValue
Expand Down Expand Up @@ -5754,7 +5737,7 @@

// Raise Warning level 2
this._sendNotification("warning",
$.ig.util.stringFormat(this._getLocaleValue("maxValExceedSetErrMsg"),
$.ig.util.stringFormat(this._getLocaleValue("minValExceedSetErrMsg"),
this.options.value));
}
}
Expand Down Expand Up @@ -6075,7 +6058,7 @@

//Notify
this._sendNotification("warning",
$.ig.util.stringFormat(this._getLocaleValue("maxValExceedSetErrMsg"),
$.ig.util.stringFormat(this._getLocaleValue("minValExceedSetErrMsg"),
this.options.minValue));
}

Expand Down
54 changes: 26 additions & 28 deletions src/js/modules/infragistics.ui.tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
* jquery.ui.draggable.js
* jquery.ui.droppable.js
* infragistics.templating.js
* infragistics.util.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.dataSource.js
* infragistics.ui.widget.js
* infragistics.ui.tree-en.js
*/

Expand All @@ -24,10 +25,6 @@

// AMD. Register as an anonymous module.
define( [
"jquery",
"jquery-ui",
"./infragistics.util",
"./infragistics.util.jquery",
"./infragistics.ui.widget",
"./infragistics.datasource",
"./infragistics.templating",
Expand Down Expand Up @@ -1740,7 +1737,12 @@
nodeDropped: "nodeDropped"
},
_createWidget: function (options) {
this._changeLocale(options);
/* !Strip dummy objects from options, because they are defined for documentation purposes only! */
this.options.bindings = null;

if (options && options.dragAndDrop) {
this._changeLocale();
}
$.Widget.prototype._createWidget.apply(this, arguments);
},
_create: function () {
Expand Down Expand Up @@ -1880,28 +1882,24 @@
break;
}
},
_changeLocale: function (options) {
/* !Strip dummy objects from options, because they are defined for documentation purposes only! */
this.options.bindings = null;
options = options || this.options;
if (options && options.dragAndDrop) {
this.options.dragAndDropSettings.moveToMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveTo") + "</p></div>";
this.options.dragAndDropSettings.moveBetweenMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveBetween") + "</p></div>";
this.options.dragAndDropSettings.moveAfterMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveAfter") + "</p></div>";
this.options.dragAndDropSettings.moveBeforeMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveBefore") + "</p></div>";
this.options.dragAndDropSettings.copyToMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyTo") + "</p></div>";
this.options.dragAndDropSettings.copyBetweenMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyBetween") + "</p></div>";
this.options.dragAndDropSettings.copyAfterMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyAfter") + "</p></div>";
this.options.dragAndDropSettings.copyBeforeMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyBefore") + "</p></div>";
}
_changeLocale: function () {
this._super();
this.options.dragAndDropSettings.moveToMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveTo") + "</p></div>";
this.options.dragAndDropSettings.moveBetweenMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveBetween") + "</p></div>";
this.options.dragAndDropSettings.moveAfterMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveAfter") + "</p></div>";
this.options.dragAndDropSettings.moveBeforeMarkup =
"<div><p><span></span>" + this._getLocaleValue("moveBefore") + "</p></div>";
this.options.dragAndDropSettings.copyToMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyTo") + "</p></div>";
this.options.dragAndDropSettings.copyBetweenMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyBetween") + "</p></div>";
this.options.dragAndDropSettings.copyAfterMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyAfter") + "</p></div>";
this.options.dragAndDropSettings.copyBeforeMarkup =
"<div><p><span></span>" + this._getLocaleValue("copyBefore") + "</p></div>";
},
_removeCheckboxes: function () {
this.element.find("span[data-role=checkbox]").remove();
Expand Down
22 changes: 19 additions & 3 deletions src/js/modules/infragistics.ui.widget.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!@license
* Infragistics.Web.ClientUI Toolbar <build_number>
* Infragistics.Web.ClientUI Base Widget <build_number>
*
* Copyright (c) 2011-<year> Infragistics Inc.
* <Licensing info>
Expand Down Expand Up @@ -37,7 +37,7 @@
$.widget("ui.igWidget", {
localeWidgetName: null,
options: {
/* type="string" Set/Get the locale setting for the widget.
/* type="string|object" Set/Get the locale setting for the widget.
```
//Initialize
$(".selector").igWidget({
Expand Down Expand Up @@ -66,7 +66,7 @@
$(".selector").igWidget("option", "regional", "ja");
```
*/
regional: "en-US"
regional: "en-US"
},
_setOption: function (option, value) {
var prevValue = this.options[ option ];
Expand All @@ -86,6 +86,22 @@
break;
}
},
_getRegionalOption: function (key) {
var regional = this.options.regional;
if (this.options[ key ]) {
return this.options[ key ];
}
if (typeof regional === "string") {
regional = $.ig.regional[ regional ];
}
if (regional && regional[ key ]) {
return regional[ key ];
} else {

// return defaults
return $.ig.regional.defaults[ key ];
}
},
_getLocaleValue: function (key) {
var locale = this.options.locale,
widgetName = this.localeWidgetName || this.widgetName.split("ig")[ 1 ];
Expand Down

0 comments on commit bcfc6cf

Please sign in to comment.