Skip to content

Commit

Permalink
RTL language support
Browse files Browse the repository at this point in the history
  • Loading branch information
moshest committed Jan 29, 2012
1 parent 6f32cc9 commit 4263e56
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
tagSource : null,
removeConfirmation: false,
caseSensitive : true,
placeholderText : null,

// When enabled, quotes are not neccesary
// for inputting multi-word tags.
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 &&
Expand All @@ -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());
});
Expand Down Expand Up @@ -387,6 +393,4 @@

});

})(jQuery);


})(jQuery);

0 comments on commit 4263e56

Please sign in to comment.