Skip to content

Commit

Permalink
switch -amp-form to i-amp-form
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinmombay committed Feb 28, 2017
1 parent 7840bea commit ade3476
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-form/0.1/amp-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class AmpForm {
if (!this.shouldValidate_) {
this.form_.setAttribute('amp-novalidate', '');
}
this.form_.classList.add('-amp-form');
this.form_.classList.add('i-amphtml-form');

const submitButtons = this.form_.querySelectorAll('[type="submit"]');
/** @const @private {!Array<!Element>} */
Expand Down Expand Up @@ -721,7 +721,7 @@ function isDisabled_(element) {
function installSubmissionHandlers(win) {
onDocumentReady(win.document, doc => {
toArray(doc.forms).forEach((form, index) => {
if (!form.classList.contains('-amp-form')) {
if (!form.classList.contains('i-amphtml-form')) {
new AmpForm(form, `amp-form-${index}`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-form/0.1/test/test-amp-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describes.realWin('amp-form', {
expect(form.addEventListener).to.be.calledWith('submit');
expect(form.addEventListener).to.be.calledWith('blur');
expect(form.addEventListener).to.be.calledWith('input');
expect(form.className).to.contain('-amp-form');
expect(form.className).to.contain('i-amphtml-form');
document.body.removeChild(form);
});

Expand Down
2 changes: 1 addition & 1 deletion src/document-submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function onDocumentFormSubmit_(e) {

// amp-form extension will add novalidate to all forms to manually trigger
// validation. In that case `novalidate` doesn't have the same meaning.
const isAmpFormMarked = form.classList.contains('-amp-form');
const isAmpFormMarked = form.classList.contains('i-amphtml-form');
let shouldValidate;
if (isAmpFormMarked) {
shouldValidate = !form.hasAttribute('amp-novalidate');
Expand Down

0 comments on commit ade3476

Please sign in to comment.