mirror of
https://github.com/caronc/apprise-api.git
synced 2025-01-21 05:19:04 +01:00
tags are now provided from a selectable list
This commit is contained in:
parent
ff3e7c216e
commit
c295291263
@ -126,16 +126,24 @@ async function update() {
|
||||
// Initialize our tags making it easy for an end user to
|
||||
// choose from. Tags are based off ones found in the saved
|
||||
// configuration.
|
||||
let external_data = tags.concat(data.tags).reduce(function(result, item) {
|
||||
result[item] = null;
|
||||
return result;
|
||||
}, {})
|
||||
|
||||
M.Chips.init(document.querySelectorAll('.chips'), {
|
||||
placeholder: 'Optional Tag',
|
||||
secondaryPlaceholder: 'Another Tag',
|
||||
autocompleteOptions: {
|
||||
data: tags.concat(data.tags).reduce(function(result, item) {
|
||||
result[item] = null;
|
||||
return result;
|
||||
}, {}),
|
||||
limit: Infinity,
|
||||
minLength: 1
|
||||
data: external_data,
|
||||
minLength: 0
|
||||
},
|
||||
onChipAdd: function(e, chip) {
|
||||
var $this = this;
|
||||
$this.chipsData.forEach(function(e, index) {
|
||||
if(!(e.tag in external_data))
|
||||
$this.deleteChip(index);
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user