sliptree/bootstrap-tokenfield — pull request #143 by icai (2014-07-10 12:22:25+00:00)
Title: fix resize bug and support custom attributes.

resize bug:

when form field use 'col-md-x' to wrap it, resize window will have problem.

support custom attributes, for example

$(selector).tokenfield({
autocomplete: {
source: [
{
value: 'green',
label: 'green',
image: 'assets/images/case-1.png'
},
{
value: 'red',
label: 'red',
image: 'assets/images/case-2.png'
},
{
value: 'blue',
label: 'blue',
image: 'assets/images/case-3.png'
},
{
value: 'kl10',
label: 'kl10',
image: 'assets/images/avatar-32-1.png'
},
{
value: 'kw10',
label: 'kw10',
image: 'assets/images/avatar-32-2.png'
},
{
value: 'kx10',
label: 'kx10',
image: 'assets/images/avatar-32-3.png'
},{
value: 'ww10',
label: 'ww10',
image: 'assets/images/avatar-34-2.png'

},{
value: 'pv120',
label: 'pv120',
image: 'assets/images/avatar-34-3.png'
},{
value: 'gd123',
label: 'gd123',
image: 'assets/images/avatar-34.png'

}],
delay: 100,
renderItem: function(ul, item){
return $( "
" )
.append( $( "" ).html( ' ' + item.label + '' ) )
.appendTo( ul );
}

},
showAutocompleteOnFocus: !0,
delimiter: [",", " ", "-", "_"],
template:{
token: '

{{label}}×

'
}
})