forked from GithubBackups/healthchecks
Fix selectize initialization when the project has 0 existing tags.
This commit is contained in:
parent
26ad94d068
commit
ab692236eb
@ -7,7 +7,12 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Configure Selectize for entering tags
|
// 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({
|
$("#update-tags-input").selectize({
|
||||||
create: true,
|
create: true,
|
||||||
createOnBlur: true,
|
createOnBlur: true,
|
||||||
@ -16,7 +21,7 @@ $(function () {
|
|||||||
searchField: ["value"],
|
searchField: ["value"],
|
||||||
hideSelected: true,
|
hideSelected: true,
|
||||||
highlight: false,
|
highlight: false,
|
||||||
options: allTags.map(function(tag) { return {value: tag} })
|
options: options
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#new-check-alert a").click(function() {
|
$("#new-check-alert a").click(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user