Permalink
Browse files

Style tweaks; rename idx to tokenIndex on removeToken event facade.

  • Loading branch information...
1 parent 5aaf87f commit aff86b3344c8932770e5429c8d6ccf16e00a179d @rgrove committed May 9, 2011
Showing with 9 additions and 10 deletions.
  1. +9 −10 js/node-tokeninput.js
View
@@ -121,9 +121,8 @@ Y.extend(TokenInput, Y.Plugin.Base, {
text : token,
token: true
}));
-
- this.fire('addToken', {'token': token})
-
+
+ this.fire('addToken', {token: token});
}
}, this);
@@ -141,9 +140,7 @@ Y.extend(TokenInput, Y.Plugin.Base, {
this._tokenNodes.refresh();
this.set(TOKENS, tokens, {atomic: true});
-
}
-
return this;
},
@@ -169,16 +166,18 @@ Y.extend(TokenInput, Y.Plugin.Base, {
* @chainable
*/
remove: function (index) {
- var tokens = this.get(TOKENS).concat();
-
- var oldToken = tokens[index];
+ var tokens = this.get(TOKENS).concat(),
+ oldToken = tokens[index];
tokens.splice(index, 1);
this._tokenNodes.item(index).remove(true);
this._tokenNodes.refresh();
-
- this.fire('removeToken', {token: oldToken, idx: index});
+
+ this.fire('removeToken', {
+ token : oldToken,
+ tokenIndex: index
+ });
return this.set(TOKENS, tokens, {atomic: true});
},

0 comments on commit aff86b3

Please sign in to comment.