Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ragulka committed Oct 21, 2014
1 parent d766830 commit 82683ff
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bootstrap-tokenfield.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-tokenfield",
"version": "0.12.0",
"version": "0.12.1",
"title": "bootstrap-tokenfield",
"author": {
"name": "ragulka",
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap-tokenfield",
"description": "Advanced tagging/tokenizing plugin for input fields with a focus on keyboard and copy-paste support.",
"version": "0.12.0",
"version": "0.12.1",
"authors": [
{
"name": "ragulka",
Expand Down
18 changes: 8 additions & 10 deletions dist/bootstrap-tokenfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

// Create a new input
var id = this.$element.prop('id') || new Date().getTime() + '' + Math.floor((1 + Math.random()) * 100)
this.$input = $('<input type="text" class="token-input" autocomplete="off" />')
this.$input = $('<input type="'+this.options.inputType+'" class="token-input" autocomplete="off" />')
.appendTo( this.$wrapper )
.prop( 'placeholder', this.$element.prop('placeholder') )
.prop( 'id', id + '-tokenfield' )
Expand Down Expand Up @@ -215,7 +215,7 @@
}

// Normalize label and value
attrs.value = $.trim(attrs.value);
attrs.value = $.trim(attrs.value.toString());
attrs.label = attrs.label && attrs.label.length ? $.trim(attrs.label) : attrs.value

// Bail out if has no value or label, or label is too short
Expand Down Expand Up @@ -480,11 +480,11 @@
case 13: // enter

// We will handle creating tokens from autocomplete in autocomplete events
if (this.$input.data('ui-autocomplete') && this.$input.data('ui-autocomplete').menu.element.find("li:has(a.ui-state-focus)").length) break
if (this.$input.data('ui-autocomplete') && this.$input.data('ui-autocomplete').menu.element.find("li:has(a.ui-state-focus), li.ui-state-focus").length) break

// We will handle creating tokens from typeahead in typeahead events
if (this.$input.hasClass('tt-input') && this.$wrapper.find('.tt-cursor').length ) break
if (this.$input.hasClass('tt-input') && this.$wrapper.find('.tt-hint').val().length) break
if (this.$input.hasClass('tt-input') && this.$wrapper.find('.tt-hint').val() && this.$wrapper.find('.tt-hint').val().length) break

// Create token
if (this.$input.is(document.activeElement) && this.$input.val().length || this.$input.data('edit')) {
Expand Down Expand Up @@ -534,7 +534,7 @@
var opposite = direction === 'prev' ? 'next' : 'prev'
, position = direction === 'prev' ? 'first' : 'last'

_self.firstActiveToken[opposite + 'All']('.token').each(function() {
_self.$firstActiveToken[opposite + 'All']('.token').each(function() {
_self.deactivate( $(this) )
})

Expand All @@ -546,11 +546,9 @@
}

, keypress: function(e) {
this.lastKeyPressCode = e.keyCode
this.lastKeyPressCharCode = e.charCode

// Comma
if ($.inArray( e.charCode, this._triggerKeys) !== -1 && this.$input.is(document.activeElement)) {
if ($.inArray( e.which, this._triggerKeys) !== -1 && this.$input.is(document.activeElement)) {
if (this.$input.val()) {
this.createTokensFromInput(e)
}
Expand Down Expand Up @@ -963,7 +961,6 @@
this.$mirror.remove();

var $_element = this.$element;
delete this;

return $_element;
}
Expand Down Expand Up @@ -1012,7 +1009,8 @@
showAutocompleteOnFocus: false,
createTokensOnBlur: false,
delimiter: ',',
beautify: true
beautify: true,
inputType: 'text'
}

$.fn.tokenfield.Constructor = Tokenfield
Expand Down
Loading

1 comment on commit 82683ff

@jpcodr
Copy link

@jpcodr jpcodr commented on 82683ff Jan 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually version on npm registry is 0.12.0.
Can you update the package @ragulka ?
thanks 😃

Please sign in to comment.