Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More closure fixes #1570

Merged
merged 7 commits into from
Sep 9, 2015
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
4 changes: 3 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
"excludeFiles": ["node_modules/**"],
"maximumLineLength": 130,
"validateQuoteMarks": "'",
"requireDotNotation": false,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"additionalRules": ["utils/jscs-rules/*.js"],
"closureCamelCase": true,
"jsDoc": {
"checkAnnotations": {
"preset": "closurecompiler",
"extra": {
"type": true
"type": true,
"suppress": true
}
},
"checkTypes": "strictNativeCase",
Expand Down
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"undef": true,
"unused": "vars",
"strict": true,
"sub": true,
"globals": {
"componentHandler": true
}
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ gulp.task('scripts', ['jscs', 'jshint'], function() {
'src/ripple/ripple.js'
];
return gulp.src(sources)
.pipe(uniffe())
.pipe($.if(/mdlComponentHandler\.js/, $.util.noop(), uniffe()))
.pipe($.sourcemaps.init())
// Concatenate Scripts
.pipe($.concat('material.js'))
Expand Down
4 changes: 3 additions & 1 deletion src/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Initialize instance.
this.init();
};
window.MaterialButton = MaterialButton;
window['MaterialButton'] = MaterialButton;

/**
* Store constants in one place so they can be updated easily.
Expand Down Expand Up @@ -79,6 +79,7 @@
MaterialButton.prototype.disable = function() {
this.element_.disabled = true;
};
MaterialButton.prototype['disable'] = MaterialButton.prototype.disable;

/**
* Enable button.
Expand All @@ -88,6 +89,7 @@
MaterialButton.prototype.enable = function() {
this.element_.disabled = false;
};
MaterialButton.prototype['enable'] = MaterialButton.prototype.enable;

/**
* Initialize element.
Expand Down
10 changes: 9 additions & 1 deletion src/checkbox/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Initialize instance.
this.init();
};
window.MaterialCheckbox = MaterialCheckbox;
window['MaterialCheckbox'] = MaterialCheckbox;

/**
* Store constants in one place so they can be updated easily.
Expand Down Expand Up @@ -145,6 +145,8 @@
this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
}
};
MaterialCheckbox.prototype['checkToggleState'] =
MaterialCheckbox.prototype.checkToggleState;

/**
* Check the inputs disabled state and update display.
Expand All @@ -158,6 +160,8 @@
this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
}
};
MaterialCheckbox.prototype['checkDisabled'] =
MaterialCheckbox.prototype.checkDisabled;

/**
* Disable checkbox.
Expand All @@ -168,6 +172,7 @@
this.inputElement_.disabled = true;
this.updateClasses_();
};
MaterialCheckbox.prototype['disable'] = MaterialCheckbox.prototype.disable;

/**
* Enable checkbox.
Expand All @@ -178,6 +183,7 @@
this.inputElement_.disabled = false;
this.updateClasses_();
};
MaterialCheckbox.prototype['enable'] = MaterialCheckbox.prototype.enable;

/**
* Check checkbox.
Expand All @@ -188,6 +194,7 @@
this.inputElement_.checked = true;
this.updateClasses_();
};
MaterialCheckbox.prototype['check'] = MaterialCheckbox.prototype.check;

/**
* Uncheck checkbox.
Expand All @@ -198,6 +205,7 @@
this.inputElement_.checked = false;
this.updateClasses_();
};
MaterialCheckbox.prototype['uncheck'] = MaterialCheckbox.prototype.uncheck;

/**
* Initialize element.
Expand Down
10 changes: 5 additions & 5 deletions src/data-table/data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
this.init();
};

window.MaterialDataTable = MaterialDataTable;
window['MaterialDataTable'] = MaterialDataTable;

/**
* Store constants in one place so they can be updated easily.
Expand Down Expand Up @@ -66,7 +66,7 @@
*
* @param {Element} checkbox Checkbox that toggles the selection state.
* @param {HTMLElement} row Row to toggle when checkbox changes.
* @param {NodeList=} opt_rows Rows to toggle when checkbox changes.
* @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes.
* @private
*/
MaterialDataTable.prototype.selectRow_ = function(checkbox, row, opt_rows) {
Expand All @@ -87,13 +87,13 @@
if (checkbox.checked) {
for (i = 0; i < opt_rows.length; i++) {
el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox');
el.MaterialCheckbox.check();
el['MaterialCheckbox'].check();
opt_rows[i].classList.add(this.CssClasses_.IS_SELECTED);
}
} else {
for (i = 0; i < opt_rows.length; i++) {
el = opt_rows[i].querySelector('td').querySelector('.mdl-checkbox');
el.MaterialCheckbox.uncheck();
el['MaterialCheckbox'].uncheck();
opt_rows[i].classList.remove(this.CssClasses_.IS_SELECTED);
}
}
Expand All @@ -106,7 +106,7 @@
* event handling.
*
* @param {HTMLElement} row Row to toggle when checkbox changes.
* @param {NodeList=} opt_rows Rows to toggle when checkbox changes.
* @param {(Array<Object>|NodeList)=} opt_rows Rows to toggle when checkbox changes.
* @private
*/
MaterialDataTable.prototype.createCheckbox_ = function(row, opt_rows) {
Expand Down
12 changes: 11 additions & 1 deletion src/icon-toggle/icon-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Initialize instance.
this.init();
};
window.MaterialIconToggle = MaterialIconToggle;
window['MaterialIconToggle'] = MaterialIconToggle;

/**
* Store constants in one place so they can be updated easily.
Expand Down Expand Up @@ -141,6 +141,8 @@
this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
}
};
MaterialIconToggle.prototype['checkToggleState'] =
MaterialIconToggle.prototype.checkToggleState;

/**
* Check the inputs disabled state and update display.
Expand All @@ -154,6 +156,8 @@
this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
}
};
MaterialIconToggle.prototype['checkDisabled'] =
MaterialIconToggle.prototype.checkDisabled;

/**
* Disable icon toggle.
Expand All @@ -164,6 +168,8 @@
this.inputElement_.disabled = true;
this.updateClasses_();
};
MaterialIconToggle.prototype['disable'] =
MaterialIconToggle.prototype.disable;

/**
* Enable icon toggle.
Expand All @@ -174,6 +180,7 @@
this.inputElement_.disabled = false;
this.updateClasses_();
};
MaterialIconToggle.prototype['enable'] = MaterialIconToggle.prototype.enable;

/**
* Check icon toggle.
Expand All @@ -184,6 +191,7 @@
this.inputElement_.checked = true;
this.updateClasses_();
};
MaterialIconToggle.prototype['check'] = MaterialIconToggle.prototype.check;

/**
* Uncheck icon toggle.
Expand All @@ -194,6 +202,8 @@
this.inputElement_.checked = false;
this.updateClasses_();
};
MaterialIconToggle.prototype['uncheck'] =
MaterialIconToggle.prototype.uncheck;

/**
* Initialize element.
Expand Down
2 changes: 1 addition & 1 deletion src/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Initialize instance.
this.init();
};
window.MaterialLayout = MaterialLayout;
window['MaterialLayout'] = MaterialLayout;

/**
* Store constants in one place so they can be updated easily.
Expand Down
Loading