Browse Source

Fix selectize initialization when the project has 0 existing tags.

pull/342/head
Pēteris Caune 5 years ago
parent
commit
ab692236eb
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      static/js/details.js

+ 7
- 2
static/js/details.js View File

@ -7,7 +7,12 @@ $(function () {
});
// Configure Selectize for entering tags
var allTags = $("#update-tags-input").data("all-tags").split(" ");
function toOption(tag) {
return {value: tag}
}
var allTags = $("#update-tags-input").data("all-tags");
var options = allTags ? allTags.split(" ").map(toOption) : [];
$("#update-tags-input").selectize({
create: true,
createOnBlur: true,
@ -16,7 +21,7 @@ $(function () {
searchField: ["value"],
hideSelected: true,
highlight: false,
options: allTags.map(function(tag) { return {value: tag} })
options: options
});
$("#new-check-alert a").click(function() {


Loading…
Cancel
Save