Skip to content

Commit

Permalink
Revert "Merge pull request #56 from paracycle/maxlength"
Browse files Browse the repository at this point in the history
This reverts commit 18bd6b0, reversing
changes made to 0d99837.

Conflicts:

	lib/main.js
  • Loading branch information
James Allardice committed Nov 29, 2013
1 parent ac81e58 commit 3fc2b4f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@
elem.className = elem.className.replace(classNameRegExp, "");

// Restore the maxlength value
if (elem.hasAttribute(ATTR_MAXLENGTH)) {
maxLength = elem.getAttribute(ATTR_MAXLENGTH);
if (maxLength > 0) {
elem.setAttribute("maxLength", maxLength);
elem.removeAttribute(ATTR_MAXLENGTH);
}
maxLength = elem.getAttribute(ATTR_MAXLENGTH);
if (maxLength) {
elem.setAttribute("maxLength", maxLength);
elem.removeAttribute(ATTR_MAXLENGTH);
}

// If the polyfill has changed the type of the element we need to change it back
Expand All @@ -115,12 +113,10 @@
elem.className += " " + placeholderClassName;

// Store and remove the maxlength value
if (elem.hasAttribute("maxLength")) {
maxLength = elem.getAttribute("maxLength") || elem.maxLength;
if (maxLength > 0) {
elem.setAttribute(ATTR_MAXLENGTH, maxLength);
elem.removeAttribute("maxLength");
}
maxLength = elem.getAttribute(ATTR_MAXLENGTH);
if (!maxLength) {
elem.setAttribute(ATTR_MAXLENGTH, elem.maxLength);
elem.removeAttribute("maxLength");
}

// If the type of element needs to change, change it (e.g. password inputs)
Expand Down

0 comments on commit 3fc2b4f

Please sign in to comment.