Skip to content
Browse files

RTL language support

  • Loading branch information...
1 parent 6f32cc9 commit 4263e5694102c7b6975ab9b0689f360fa4e21889 @moshest moshest committed Jan 29, 2012
Showing with 13 additions and 9 deletions.
  1. +13 −9 js/tag-it.js
View
22 js/tag-it.js
@@ -34,7 +34,6 @@
tagSource : null,
removeConfirmation: false,
caseSensitive : true,
- placeholderText : null,
// When enabled, quotes are not neccesary
// for inputting multi-word tags.
@@ -101,9 +100,6 @@
if (this.options.tabIndex) {
this._tagInput.attr('tabindex', this.options.tabIndex);
}
- if (this.options.placeholderText) {
- this._tagInput.attr('placeholder', this.options.placeholderText);
- }
this.options.tagSource = this.options.tagSource || function(search, showChoices) {
var filter = search.term.toLowerCase();
@@ -181,7 +177,6 @@
// except when there is an open quote or if setting allowSpaces = true.
// Tab will also create a tag, unless the tag input is empty, in which case it isn't caught.
if (
- event.which == $.ui.keyCode.COMMA ||
event.which == $.ui.keyCode.ENTER ||
(
event.which == $.ui.keyCode.TAB &&
@@ -207,7 +202,18 @@
// So let's ensure that it closes.
that._tagInput.autocomplete('close');
}
- }).blur(function(e){
+ })
+ .keypress(function(event) {
+ if (event.charCode == 44) {
+ event.preventDefault();
+ that.createTag(that._cleanedInput());
+
+ // The autocomplete doesn't close automatically when TAB is pressed.
+ // So let's ensure that it closes.
+ that._tagInput.autocomplete('close');
+ }
+ })
+ .blur(function(e){
// Create a tag when the element loses focus (unless it's empty).
that.createTag(that._cleanedInput());
});
@@ -387,6 +393,4 @@
});
-})(jQuery);
-
-
+})(jQuery);

0 comments on commit 4263e56

Please sign in to comment.
Something went wrong with that request. Please try again.