Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit f7d6d10

Browse files
crisbetokara
authored andcommitted
chore(): fix more jshint warnings (#9387)
Another batch of minor jshint warning fixes. Referencing #9153.
1 parent 11fd03f commit f7d6d10

File tree

35 files changed

+64
-65
lines changed

35 files changed

+64
-65
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"expr": true,
33
"boss": true,
4-
"laxbreak": true
4+
"laxbreak": true,
5+
"predef": ["angular"]
56
}

src/components/datepicker/js/dateLocaleProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
// d.toLocaleString(); // == "10/7/1992, 11:00:00 PM"
176176
var localeTime = date.toLocaleTimeString();
177177
var formatDate = date;
178-
if (date.getHours() == 0 &&
178+
if (date.getHours() === 0 &&
179179
(localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) {
180180
formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0);
181181
}

src/components/datepicker/js/dateUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
* @return {boolean} Whether the date is a valid Date.
193193
*/
194194
function isValidDate(date) {
195-
return date != null && date.getTime && !isNaN(date.getTime());
195+
return date && date.getTime && !isNaN(date.getTime());
196196
}
197197

198198
/**

src/components/fabActions/fabActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
children.wrap('<div class="md-fab-action-item">');
4444
}
4545
}
46-
}
46+
};
4747
}
4848

4949
})();

src/components/fabSpeedDial/demoMoreOptions/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
templateUrl: 'dialog.html',
4848
targetEvent: $event
4949
});
50-
}
50+
};
5151
});
5252
})();

src/components/fabSpeedDial/fabSpeedDial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
runAnimation(element);
206206
delayDone(done);
207207
}
208-
}
208+
};
209209
}
210210

211211
function MdFabSpeedDialScaleAnimation($timeout) {
@@ -248,6 +248,6 @@
248248
runAnimation(element);
249249
delayDone(done);
250250
}
251-
}
251+
};
252252
}
253253
})();

src/components/fabToolbar/fabToolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,6 @@
192192
runAnimation(element, className, done);
193193
done();
194194
}
195-
}
195+
};
196196
}
197197
})();

src/components/icon/demoLoadSvgIconsFromUrl/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ angular.module('appDemoSvgIcons', ['ngMaterial'])
55
$scope.insertDriveIconURL = 'img/icons/ic_insert_drive_file_24px.svg';
66
$scope.getAndroid = function() {
77
return 'img/icons/android.svg';
8-
}
8+
};
99
/* Returns base64 encoded SVG. */
1010
$scope.getAndroidEncoded = function() {
1111
return 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGcgaWQ9ImFuZHJvaWQiPjxwYXRoIGQ9Ik02IDE4YzAgLjU1LjQ1IDEgMSAxaDF2My41YzAgLjgzLjY3IDEuNSAxLjUgMS41czEuNS0uNjcgMS41LTEuNVYxOWgydjMuNWMwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjVWMTloMWMuNTUgMCAxLS40NSAxLTFWOEg2djEwek0zLjUgOEMyLjY3IDggMiA4LjY3IDIgOS41djdjMCAuODMuNjcgMS41IDEuNSAxLjVTNSAxNy4zMyA1IDE2LjV2LTdDNSA4LjY3IDQuMzMgOCAzLjUgOHptMTcgMGMtLjgzIDAtMS41LjY3LTEuNSAxLjV2N2MwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjV2LTdjMC0uODMtLjY3LTEuNS0xLjUtMS41em0tNC45Ny01Ljg0bDEuMy0xLjNjLjItLjIuMi0uNTEgMC0uNzEtLjItLjItLjUxLS4yLS43MSAwbC0xLjQ4IDEuNDhDMTMuODUgMS4yMyAxMi45NSAxIDEyIDFjLS45NiAwLTEuODYuMjMtMi42Ni42M0w3Ljg1LjE1Yy0uMi0uMi0uNTEtLjItLjcxIDAtLjIuMi0uMi41MSAwIC43MWwxLjMxIDEuMzFDNi45NyAzLjI2IDYgNS4wMSA2IDdoMTJjMC0xLjk5LS45Ny0zLjc1LTIuNDctNC44NHpNMTAgNUg5VjRoMXYxem01IDBoLTFWNGgxdjF6Ii8+PC9nPjwvc3ZnPg==';
12-
}
12+
};
1313
});

src/components/input/input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ function ngMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil) {
931931
done();
932932
}
933933
}
934-
}
934+
};
935935
}
936936

937937
function ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil) {
@@ -949,7 +949,7 @@ function ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil) {
949949

950950
animator.start().done(done);
951951
}
952-
}
952+
};
953953
}
954954

955955
function showInputMessages(element, done) {
@@ -1007,7 +1007,7 @@ function hideMessage(element) {
10071007
var styles = window.getComputedStyle(element[0]);
10081008

10091009
// If we are already hidden, just return an empty animation
1010-
if (styles.opacity == 0) {
1010+
if (parseInt(styles.opacity) === 0) {
10111011
return $animateCss(element, {});
10121012
}
10131013

src/components/menu/js/menuDirective.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
*
106106
* ### Auto Focus
107107
* By default, when a menu opens, `md-menu` focuses the first button in the menu content.
108-
*
108+
*
109109
* But sometimes you would like to focus another specific menu item instead of the first.<br/>
110110
* This can be done by applying the `md-autofocus` directive on the given element.
111111
*
@@ -123,7 +123,7 @@
123123
* Sometimes you would like to be able to click on a menu item without having the menu
124124
* close. To do this, ngMaterial exposes the `md-prevent-menu-close` attribute which
125125
* can be added to a button inside a menu to stop the menu from automatically closing.
126-
* You can then close the menu programatically by injecting `$mdMenu` and calling
126+
* You can then close the menu programatically by injecting `$mdMenu` and calling
127127
* `$mdMenu.hide()`.
128128
*
129129
* <hljs lang="html">
@@ -211,7 +211,7 @@ function MenuDirective($mdUtil) {
211211

212212
function link(scope, element, attr, ctrls) {
213213
var mdMenuCtrl = ctrls[0];
214-
var isInMenuBar = ctrls[1] != undefined;
214+
var isInMenuBar = !!ctrls[1];
215215
// Move everything into a md-menu-container and pass it to the controller
216216
var menuContainer = angular.element( '<div class="_md md-open-menu-container md-whiteframe-z2"></div>');
217217
var menuContents = element.children()[1];

0 commit comments

Comments
 (0)