Init
This commit is contained in:
28
resources/js/user-blacklist.js
Normal file
28
resources/js/user-blacklist.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Tagify from '@yaireo/tagify';
|
||||
import '@yaireo/tagify/dist/tagify.css';
|
||||
|
||||
const taginput = document.querySelector("#tags");
|
||||
|
||||
// Get Tags from API
|
||||
window.axios.get('/user/blacklist').then(function (response) {
|
||||
if (response.status != 200) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tagify = new Tagify(taginput, {
|
||||
whitelist: response.data.tags,
|
||||
enforceWhitelist: true,
|
||||
dropdown: {
|
||||
classname: "color-blue",
|
||||
enabled: 0, // show the dropdown immediately on focus
|
||||
maxItems: 10,
|
||||
position: "text", // place the dropdown near the typed text
|
||||
closeOnSelect: false, // keep the dropdown open after selecting a suggestion
|
||||
highlightFirst: true,
|
||||
}
|
||||
});
|
||||
|
||||
tagify.addTags(response.data.usertags);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
Reference in New Issue
Block a user