Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"expr": true,
"boss": true,
"laxbreak": true
"laxbreak": true,
"predef": ["angular"]
}
2 changes: 1 addition & 1 deletion src/components/datepicker/js/dateLocaleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
// d.toLocaleString(); // == "10/7/1992, 11:00:00 PM"
var localeTime = date.toLocaleTimeString();
var formatDate = date;
if (date.getHours() == 0 &&
if (date.getHours() === 0 &&
(localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) {
formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/datepicker/js/dateUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
* @return {boolean} Whether the date is a valid Date.
*/
function isValidDate(date) {
return date != null && date.getTime && !isNaN(date.getTime());
return date && date.getTime && !isNaN(date.getTime());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/fabActions/fabActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
children.wrap('<div class="md-fab-action-item">');
}
}
}
};
}

})();
2 changes: 1 addition & 1 deletion src/components/fabSpeedDial/demoMoreOptions/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
templateUrl: 'dialog.html',
targetEvent: $event
});
}
};
});
})();
4 changes: 2 additions & 2 deletions src/components/fabSpeedDial/fabSpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
runAnimation(element);
delayDone(done);
}
}
};
}

function MdFabSpeedDialScaleAnimation($timeout) {
Expand Down Expand Up @@ -248,6 +248,6 @@
runAnimation(element);
delayDone(done);
}
}
};
}
})();
2 changes: 1 addition & 1 deletion src/components/fabToolbar/fabToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@
runAnimation(element, className, done);
done();
}
}
};
}
})();
4 changes: 2 additions & 2 deletions src/components/icon/demoLoadSvgIconsFromUrl/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ angular.module('appDemoSvgIcons', ['ngMaterial'])
$scope.insertDriveIconURL = 'img/icons/ic_insert_drive_file_24px.svg';
$scope.getAndroid = function() {
return 'img/icons/android.svg';
}
};
/* Returns base64 encoded SVG. */
$scope.getAndroidEncoded = function() {
return 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGcgaWQ9ImFuZHJvaWQiPjxwYXRoIGQ9Ik02IDE4YzAgLjU1LjQ1IDEgMSAxaDF2My41YzAgLjgzLjY3IDEuNSAxLjUgMS41czEuNS0uNjcgMS41LTEuNVYxOWgydjMuNWMwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjVWMTloMWMuNTUgMCAxLS40NSAxLTFWOEg2djEwek0zLjUgOEMyLjY3IDggMiA4LjY3IDIgOS41djdjMCAuODMuNjcgMS41IDEuNSAxLjVTNSAxNy4zMyA1IDE2LjV2LTdDNSA4LjY3IDQuMzMgOCAzLjUgOHptMTcgMGMtLjgzIDAtMS41LjY3LTEuNSAxLjV2N2MwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjV2LTdjMC0uODMtLjY3LTEuNS0xLjUtMS41em0tNC45Ny01Ljg0bDEuMy0xLjNjLjItLjIuMi0uNTEgMC0uNzEtLjItLjItLjUxLS4yLS43MSAwbC0xLjQ4IDEuNDhDMTMuODUgMS4yMyAxMi45NSAxIDEyIDFjLS45NiAwLTEuODYuMjMtMi42Ni42M0w3Ljg1LjE1Yy0uMi0uMi0uNTEtLjItLjcxIDAtLjIuMi0uMi41MSAwIC43MWwxLjMxIDEuMzFDNi45NyAzLjI2IDYgNS4wMSA2IDdoMTJjMC0xLjk5LS45Ny0zLjc1LTIuNDctNC44NHpNMTAgNUg5VjRoMXYxem01IDBoLTFWNGgxdjF6Ii8+PC9nPjwvc3ZnPg==';
}
};
});
6 changes: 3 additions & 3 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ function ngMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil) {
done();
}
}
}
};
}

function ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil) {
Expand All @@ -942,7 +942,7 @@ function ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil) {
leave: function(element, done) {
return hideMessage(element);
}
}
};
}

function showInputMessages(element, done) {
Expand Down Expand Up @@ -1001,7 +1001,7 @@ function hideMessage(element) {
//var styles = { opacity: element.css('opacity') };

// If we are already hidden, just return an empty animation
if (styles.opacity == 0) {
if (parseInt(styles.opacity) === 0) {
return $animateCss(element, {});
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/menu/js/menuDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
*
* ### Auto Focus
* By default, when a menu opens, `md-menu` focuses the first button in the menu content.
*
*
* But sometimes you would like to focus another specific menu item instead of the first.<br/>
* This can be done by applying the `md-autofocus` directive on the given element.
*
Expand All @@ -123,7 +123,7 @@
* Sometimes you would like to be able to click on a menu item without having the menu
* close. To do this, ngMaterial exposes the `md-prevent-menu-close` attribute which
* can be added to a button inside a menu to stop the menu from automatically closing.
* You can then close the menu programatically by injecting `$mdMenu` and calling
* You can then close the menu programatically by injecting `$mdMenu` and calling
* `$mdMenu.hide()`.
*
* <hljs lang="html">
Expand Down Expand Up @@ -211,7 +211,7 @@ function MenuDirective($mdUtil) {

function link(scope, element, attr, ctrls) {
var mdMenuCtrl = ctrls[0];
var isInMenuBar = ctrls[1] != undefined;
var isInMenuBar = !!ctrls[1];
// Move everything into a md-menu-container and pass it to the controller
var menuContainer = angular.element( '<div class="_md md-open-menu-container md-whiteframe-z2"></div>');
var menuContents = element.children()[1];
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/js/menuServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function MenuProvider($$interimElementProvider) {
$window.removeEventListener('resize', repositionMenu);
$window.removeEventListener('orientationchange', repositionMenu);

}
};
}

/**
Expand Down Expand Up @@ -299,7 +299,7 @@ function MenuProvider($$interimElementProvider) {
}
break;
}
} while (target = target.parentNode)
} while (target = target.parentNode);

function close() {
scope.$apply(function() {
Expand Down
6 changes: 3 additions & 3 deletions src/components/navBar/navBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ MdNavBarController.prototype._getTabs = function() {
var linkArray = Array.prototype.slice.call(
this._navBarEl.querySelectorAll('.md-nav-item'));
return linkArray.map(function(el) {
return angular.element(el).controller('mdNavItem')
return angular.element(el).controller('mdNavItem');
});
};

Expand All @@ -280,7 +280,7 @@ MdNavBarController.prototype._getTabByName = function(name) {
*/
MdNavBarController.prototype._getSelectedTab = function() {
return this._findTab(function(tab) {
return tab.isSelected()
return tab.isSelected();
});
};

Expand All @@ -290,7 +290,7 @@ MdNavBarController.prototype._getSelectedTab = function() {
*/
MdNavBarController.prototype.getFocusedTab = function() {
return this._findTab(function(tab) {
return tab.hasFocus()
return tab.hasFocus();
});
};

Expand Down
14 changes: 7 additions & 7 deletions src/components/panel/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ PanelMenuCtrl.prototype.selectDessert = function(dessert) {


PanelMenuCtrl.prototype.onKeydown = function($event, dessert) {
var handled;
var handled, els, index, prevIndex, nextIndex;
switch ($event.which) {
case 38: // Up Arrow.
var els = document.querySelectorAll('.demo-menu-item');
var index = indexOf(els, document.activeElement);
var prevIndex = (index + els.length - 1) % els.length;
els = document.querySelectorAll('.demo-menu-item');
index = indexOf(els, document.activeElement);
prevIndex = (index + els.length - 1) % els.length;
els[prevIndex].focus();
handled = true;
break;

case 40: // Down Arrow.
var els = document.querySelectorAll('.demo-menu-item');
var index = indexOf(els, document.activeElement);
var nextIndex = (index + 1) % els.length;
els = document.querySelectorAll('.demo-menu-item');
index = indexOf(els, document.activeElement);
nextIndex = (index + 1) % els.length;
els[nextIndex].focus();
handled = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/components/progressLinear/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ angular.module('progressLinearDemo1', ['ngMaterial'])
if ( (j < 2) && !self.showList[j] && self.activated ) {
self.showList[j] = true;
}
if ( counter++ % 4 == 0 ) j++;
if ( counter++ % 4 === 0 ) j++;

// Show the indicator in the "Used within Containers" after 200ms delay
if ( j == 2 ) self.contained = "indeterminate";
Expand Down
2 changes: 1 addition & 1 deletion src/components/radioButton/demoMultiColumn/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ angular
self.selectedId = 2;
self.selectedUser = function() {
return $filter('filter')(self.contacts, { id: self.selectedId })[0].lastName;
}
};
});
2 changes: 1 addition & 1 deletion src/components/select/demoValidations/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ angular.module('selectDemoValidation', ['ngMaterial', 'ngMessages'])
$scope.clearValue = function() {
$scope.quest = undefined;
$scope.favoriteColor = undefined;
$scope.myForm.$setPristine();;
$scope.myForm.$setPristine();
};
$scope.save = function() {
if ($scope.myForm.$valid) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidenav/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ angular
.then(function () {
$log.debug("toggle " + navID + " is done");
});
}
};
}
})
.controller('LeftCtrl', function ($scope, $timeout, $mdSidenav, $log) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidenav/demoCustomSidenav/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ angular
function buildToggler(componentId) {
return function() {
$mdSidenav(componentId).toggle();
}
};
}
});
4 changes: 2 additions & 2 deletions src/components/tabs/js/tabDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function MdTab () {
var label = firstChild(element, 'md-tab-label'),
body = firstChild(element, 'md-tab-body');

if (label.length == 0) {
if (label.length === 0) {
label = angular.element('<md-tab-label></md-tab-label>');
if (attr.label) label.text(attr.label);
else label.append(element.contents());

if (body.length == 0) {
if (body.length === 0) {
var contents = element.contents().detach();
body = angular.element('<md-tab-body></md-tab-body>');
body.append(contents);
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/js/tabScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ function MdTabScroll ($parse) {
});
};
}
}
};
}
2 changes: 1 addition & 1 deletion src/components/tabs/js/tabsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
function adjustOffset (index) {
var elements = getElements();

if (index == null) index = ctrl.focusIndex;
if (!angular.isNumber(index)) index = ctrl.focusIndex;
if (!elements.tabs[ index ]) return;
if (ctrl.shouldCenterTabs) return;
var tab = elements.tabs[ index ],
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/js/tabsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function MdTabs ($$mdSvgRegistry) {
selectedIndex: '=?mdSelected'
},
template: function (element, attr) {
attr[ "$mdTabsTemplate" ] = element.html();
attr.$mdTabsTemplate = element.html();
return '' +
'<md-tabs-wrapper> ' +
'<md-tab-data></md-tab-data> ' +
Expand Down
2 changes: 1 addition & 1 deletion src/components/toast/demoCustomUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
)
.then(function() {
isDlgOpen = false;
})
});
};
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/tooltip/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ angular.module('tooltipDemo1', ['ngMaterial'])
if (val && val.length ) {
$scope.demo.showTooltip = true;
}
})
});
});
6 changes: 3 additions & 3 deletions src/core/services/interimElement/interimElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,14 @@ function InterimElementProvider() {
autoHideTimer = $timeout(service.hide, options.hideDelay) ;
cancelAutoHide = function() {
$timeout.cancel(autoHideTimer);
}
};
}

// Cache for subsequent use
options.cancelAutoHide = function() {
cancelAutoHide();
options.cancelAutoHide = undefined;
}
};
}

/**
Expand Down Expand Up @@ -663,7 +663,7 @@ function InterimElementProvider() {
// Trigger callback *before* the remove operation starts
announceRemoving(element, action);

if ( options.$destroy == true ) {
if ( options.$destroy ) {

// For $destroy, onRemove should be synchronous
resolve(element);
Expand Down
6 changes: 3 additions & 3 deletions src/core/services/ripple/button_ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
return {
isMenuItem: element.hasClass('md-menu-item'),
dimBackground: true
}
};
}
};
};
}
}
})();
4 changes: 2 additions & 2 deletions src/core/services/ripple/checkbox_ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
dimBackground: false,
fitRipple: true
}, options));
};
};
}
}
})();
4 changes: 2 additions & 2 deletions src/core/services/ripple/list_ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
outline: false,
rippleSize: 'full'
}, options));
};
};
}
}
})();
4 changes: 2 additions & 2 deletions src/core/services/ripple/tab_ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
outline: false,
rippleSize: 'full'
}, options));
};
};
}
}
})();
2 changes: 1 addition & 1 deletion src/core/services/theming/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
return function () {
removeChrome();
removeWindows();
}
};
};

/**
Expand Down
Loading