diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2013-07-29 15:10:12 -0400 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2013-07-29 15:10:12 -0400 |
commit | cc200e3678db7a7517a68b9b9982bf98049fab35 (patch) | |
tree | 4efdefbf6107876f2f1c8a8049774511a32aab92 /src | |
parent | 86ef1ba6372e4129fb47a912dae5927d0773a547 (diff) | |
download | jQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.zip jQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.tar.gz jQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.tar.bz2 |
fix lint issues, grunt less error
Diffstat (limited to 'src')
-rw-r--r-- | src/.jshintrc | 1 | ||||
-rw-r--r-- | src/jquery-ui-timepicker-addon.js | 17 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/.jshintrc b/src/.jshintrc index 86b3a7c..d3d850f 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -1,4 +1,5 @@ { + "evil": true, "curly": true, "eqeqeq": true, "immed": true, diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js index 37bfadb..38ddb4b 100644 --- a/src/jquery-ui-timepicker-addon.js +++ b/src/jquery-ui-timepicker-addon.js @@ -10,8 +10,6 @@ * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt */ -/*jslint evil: true, white: false, undef: false */ - (function ($) { /* @@ -756,9 +754,8 @@ // If the update was done in the input field, the input field should not be updated. // If the update was done using the sliders, update the input field. - var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || microsec != this.microsec - || (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) - || (this.timezone !== null && timezone != this.timezone)); + var hasChanged = (hour !== this.hour || minute !== this.minute || second !== this.second || millisec !== this.millisec || microsec !== this.microsec || + (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone)); if (hasChanged) { @@ -1358,7 +1355,7 @@ // don't popup the datepicker if there is another instance already opened var input = inst.input[0]; - if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) { + if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) { return; } @@ -1410,9 +1407,9 @@ /* * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField + * Update any alternate field to synchronise with the main field. */ $.datepicker._base_updateAlternate = $.datepicker._updateAlternate; - /* Update any alternate field to synchronise with the main field. */ $.datepicker._updateAlternate = function (inst) { var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { @@ -1452,7 +1449,7 @@ tp_inst = $.datepicker._get(inst, 'timepicker'); if (tp_inst) { - if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) { + if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) { try { $.datepicker._updateDatepicker(inst); } catch (err) { @@ -1803,7 +1800,7 @@ var detectSupport = function (timeFormat) { var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals isIn = function (f, t) { // does the format contain the token? - return !!(f.indexOf(t) !== -1); + return f.indexOf(t) !== -1 ? true : false; }; return { hour: isIn(tf, 'h'), @@ -2098,7 +2095,7 @@ */ $.timepicker.log = function (err) { if (window.console) { - console.log(err); + window.console.log(err); } }; |