Skip to content

Commit

Permalink
Code conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
James Allardice committed Nov 29, 2013
1 parent f3bf2af commit ac81e58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

function handleElem(node, callback) {

var handleInputs, handleTextareas, elem, len, i;
var handleInputsLength, handleTextareasLength, handleInputs, handleTextareas, elem, len, i;

// Check if the passed in node is an input/textarea (in which case it can't have any affected descendants)
if (node && node.getAttribute(ATTR_CURRENT_VAL)) {
Expand All @@ -150,11 +150,11 @@
handleInputs = node ? node.getElementsByTagName("input") : inputs;
handleTextareas = node ? node.getElementsByTagName("textarea") : textareas;

var handleInputsLength = handleInputs ? handleInputs.length : 0;
var handleTextAreasLength = handleTextareas ? handleTextareas.length : 0;
handleInputsLength = handleInputs ? handleInputs.length : 0;
handleTextareasLength = handleTextareas ? handleTextareas.length : 0;

// Run the callback for each element
for (i = 0, len = handleInputsLength + handleTextAreasLength; i < len; i++) {
for (i = 0, len = handleInputsLength + handleTextareasLength; i < len; i++) {
elem = i < handleInputsLength ? handleInputs[i] : handleTextareas[i - handleInputsLength];
callback(elem);
}
Expand Down

0 comments on commit ac81e58

Please sign in to comment.