Skip to content

Commit

Permalink
Merge pull request #38 from Raven24/init-reset
Browse files Browse the repository at this point in the history
Resetting inputs on initialization, to avoid browser re-fill.
  • Loading branch information
auchenberg committed May 10, 2012
2 parents 9b9852b + 8a177b1 commit 75adb0a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jquery.mentionsInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@
}
}

function reset() {
elmInputBox.val('');
mentionsCollection = [];
updateValues();
}

// Public methods
return {
init : function (options) {
Expand All @@ -335,6 +341,7 @@
initTextarea();
initAutocomplete();
initMentionsOverlay();
reset();
},

val : function (callback) {
Expand All @@ -347,9 +354,7 @@
},

reset : function () {
elmInputBox.val('');
mentionsCollection = [];
updateValues();
reset();
},

getMentions : function (callback) {
Expand Down

0 comments on commit 75adb0a

Please sign in to comment.