Skip to content

Commit

Permalink
Merge pull request #111 from tedeh/dev
Browse files Browse the repository at this point in the history
Remove container on input destroy
  • Loading branch information
Twipped committed Oct 24, 2013
2 parents 0ef72af + a5e42f3 commit 4507a61
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
10 changes: 8 additions & 2 deletions build/kalendae.js
Expand Up @@ -591,10 +591,14 @@ var parseDates = function (input, delimiter, format) {
}

var c = input.length,
i = 0;
i = 0,
m;

do {
if (input[i]) output.push( moment(input[i], format).hours(12) );
if (input[i]) {
m = moment(input[i], format).hours(12);
if (m.isValid()) output.push(m);
}
} while (++i < c);

return output;
Expand Down Expand Up @@ -967,6 +971,8 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
util.removeEvent($input, 'blur', this._events.inputBlur);

util.removeEvent($input, 'keyup', this._events.inputKeyup);

$container.remove();
}
});

Expand Down
10 changes: 8 additions & 2 deletions build/kalendae.standalone.js
Expand Up @@ -591,10 +591,14 @@ var parseDates = function (input, delimiter, format) {
}

var c = input.length,
i = 0;
i = 0,
m;

do {
if (input[i]) output.push( moment(input[i], format).hours(12) );
if (input[i]) {
m = moment(input[i], format).hours(12);
if (m.isValid()) output.push(m);
}
} while (++i < c);

return output;
Expand Down Expand Up @@ -967,6 +971,8 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
util.removeEvent($input, 'blur', this._events.inputBlur);

util.removeEvent($input, 'keyup', this._events.inputKeyup);

$container.remove();
}
});

Expand Down
2 changes: 2 additions & 0 deletions src/input.js
Expand Up @@ -156,6 +156,8 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
util.removeEvent($input, 'blur', this._events.inputBlur);

util.removeEvent($input, 'keyup', this._events.inputKeyup);

$container.remove();
}
});

0 comments on commit 4507a61

Please sign in to comment.