Closed #48
This commit is contained in:
parent
6b55706fb4
commit
0f72ef3963
3 changed files with 28 additions and 12 deletions
|
@ -179,3 +179,25 @@ $(function()
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
function getTagItOptions()
|
||||
{
|
||||
return {
|
||||
caseSensitive: false,
|
||||
autocomplete:
|
||||
{
|
||||
source:
|
||||
function(request, response)
|
||||
{
|
||||
var term = request.term.toLowerCase();
|
||||
var results = $.grep(this.options.availableTags, function(a)
|
||||
{
|
||||
return a.toLowerCase().indexOf(term) != -1;
|
||||
});
|
||||
if (!this.options.allowDuplicates)
|
||||
results = this._subtractArray(results, this.assignedTags());
|
||||
response(results);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,12 +14,9 @@ $(function()
|
|||
{
|
||||
tags = data['tags'];
|
||||
|
||||
var tagItOptions =
|
||||
{
|
||||
caseSensitive: true,
|
||||
availableTags: tags,
|
||||
placeholderText: $('.tags input').attr('placeholder')
|
||||
};
|
||||
var tagItOptions = getTagItOptions();
|
||||
tagItOptions.availableTags = tags;
|
||||
tagItOptions.placeholderText = $('.tags input').attr('placeholder');
|
||||
$('.tags input').tagit(tagItOptions);
|
||||
|
||||
e.preventDefault();
|
||||
|
|
|
@ -158,12 +158,9 @@ $(function()
|
|||
$('.posts').append(postDom);
|
||||
|
||||
postDom.show();
|
||||
var tagItOptions =
|
||||
{
|
||||
caseSensitive: true,
|
||||
availableTags: tags,
|
||||
placeholderText: $('.tags input').attr('placeholder')
|
||||
};
|
||||
var tagItOptions = getTagItOptions();
|
||||
tagItOptions.availableTags = tags;
|
||||
tagItOptions.placeholderText = $('.tags input').attr('placeholder');
|
||||
$('.tags input', postDom).tagit(tagItOptions);
|
||||
|
||||
if (!file.type.match('image.*'))
|
||||
|
|
Loading…
Reference in a new issue