.autocomplete_tags as the class to indicate we want tag autocompletion

This commit is contained in:
Shish 2018-07-20 00:32:49 +01:00
parent c75e7060e6
commit 8ea25a4e90

View file

@ -1,7 +1,7 @@
$(function(){
var metatags = ['order:id', 'order:width', 'order:height', 'order:filesize', 'order:filename'];
$('[name=search]').tagit({
$('.autocomplete_tags').tagit({
singleFieldDelimiter: ' ',
beforeTagAdded: function(event, ui) {
if(metatags.indexOf(ui.tagLabel) !== -1) {
@ -66,7 +66,7 @@ $(function(){
if(keyCode == 32) {
e.preventDefault();
$('[name=search]').tagit('createTag', $(this).val());
$('.autocomplete_tags').tagit('createTag', $(this).val());
$(this).autocomplete('close');
} else if (keyCode == 9) {
e.preventDefault();