Permalink
Browse files

Change prepopulate; using insert_token didn't update the input box, s…

…witched to create_token instead.
  • Loading branch information...
1 parent ef9e22a commit 0c5304574cb455209a95202b1d756e8c6825fc7a Nick Spacek committed Sep 16, 2009
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/jquery.tokeninput.js
View
5 src/jquery.tokeninput.js
@@ -203,7 +203,6 @@ $.TokenList = function (input, settings) {
// The list to store the token items in
var token_list = $("<ul />")
- .css('width', hidden_input.width())
.addClass(settings.classes.tokenList)
.insertAfter(hidden_input)
.click(function (event) {
@@ -282,7 +281,7 @@ $.TokenList = function (input, settings) {
function init_list () {
if(settings.prePopulate) {
$.each(settings.prePopulate, function(i, item) {
- insert_token(item.id, item.name);
+ create_token(item);
});
}
}
@@ -354,7 +353,7 @@ $.TokenList = function (input, settings) {
// Save this token id
var id_string = li_data.id + ","
hidden_input.val(hidden_input.val() + id_string);
-
+
token_count++;
if(settings.tokenLimit != null && settings.tokenLimit >= token_count) {

0 comments on commit 0c53045

Please sign in to comment.