Merge pull request #467 from sgomes/material-sprint-style-fixes

Style fixes across the material-sprint branch.
This commit is contained in:
Addy Osmani 2014-10-15 10:40:16 +01:00
commit b035eae767
8 changed files with 46 additions and 39 deletions

View File

@ -19,6 +19,5 @@
(function() {
'use strict';
var querySelector = document.querySelector.bind(document);
// TODO: Do we still need this file?
})();

View File

@ -3,7 +3,9 @@
function PaperButton(el) {
var buttonElement = el;
var rippleElement = buttonElement.querySelector('.PaperButton-ripple');
var frameCount = 0, x, y;
var frameCount = 0;
var x;
var y;
if (rippleElement) {
var bound = buttonElement.getBoundingClientRect();
@ -28,7 +30,8 @@ function PaperButton(el) {
};
this.setRippleXY = function(newX, newY) {
x = newX, y = newY;
x = newX;
y = newY;
};
this.animFrameHandler = function() {
@ -58,7 +61,8 @@ PaperButton.prototype.onClickHandler = function(evt) {
this.setFrameCount(1);
var bound = evt.currentTarget.getBoundingClientRect();
var x, y;
var x;
var y;
// Check if we are handling a keyboard click
if (event.clientX === 0 && event.clientY === 0) {
x = Math.round(bound.width / 2);

View File

@ -102,7 +102,6 @@
sidenav.close();
});
menuButton.addEventListener('click', function(evt) {
sidenav.toggle();
});

View File

@ -27,9 +27,12 @@ function RadioButton(btnElement, labelElement) {
};
labelElement.addEventListener('click', this.onClick.bind(this));
ripple.addEventListener('webkitTransitionEnd', this.onEndOfRippleTransition.bind(this));
ripple.addEventListener('oTransitionEnd', this.onEndOfRippleTransition.bind(this));
ripple.addEventListener('transitionEnd', this.onEndOfRippleTransition.bind(this));
ripple.addEventListener('webkitTransitionEnd',
this.onEndOfRippleTransition.bind(this));
ripple.addEventListener('oTransitionEnd',
this.onEndOfRippleTransition.bind(this));
ripple.addEventListener('transitionEnd',
this.onEndOfRippleTransition.bind(this));
}
window.addEventListener('load', function() {

View File

@ -9,7 +9,8 @@ function TextField(element) {
if (inputElement.hasAttribute('maxrows')) {
maxRows = parseInt(inputElement.getAttribute('maxrows'), 10);
if (isNaN(maxRows)) {
console.log('maxrows attribute provided, but wasn\'t a number: '+maxRows);
console.log(
'maxrows attribute provided, but wasn\'t a number: ' + maxRows);
maxRows = NO_MAX_ROWS;
}
}

View File

@ -1,3 +1,5 @@
'use strict';
// From: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
// shim layer with setTimeout fallback
window.requestAnimFrame = (function() {

View File

@ -42,7 +42,7 @@ var AUTOPREFIXER_BROWSERS = [
// Lint JavaScript
gulp.task('jshint', function() {
return gulp.src('app/scripts/**/*.js')
return gulp.src(['app/scripts/**/*.js', 'app/styleguide/**/*.js'])
.pipe(reload({stream: true, once: true}))
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
@ -91,8 +91,7 @@ gulp.task('styles', function () {
style: 'expanded',
precision: 10
})
.on('error', console.error.bind(console))
)
.on('error', console.error.bind(console)))
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp'))
// Concatenate And Minify Styles