mirror of
https://github.com/caronc/apprise-api.git
synced 2025-02-08 05:49:34 +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
|
// Initialize our tags making it easy for an end user to
|
||||||
// choose from. Tags are based off ones found in the saved
|
// choose from. Tags are based off ones found in the saved
|
||||||
// configuration.
|
// configuration.
|
||||||
|
let external_data = tags.concat(data.tags).reduce(function(result, item) {
|
||||||
|
result[item] = null;
|
||||||
|
return result;
|
||||||
|
}, {})
|
||||||
|
|
||||||
M.Chips.init(document.querySelectorAll('.chips'), {
|
M.Chips.init(document.querySelectorAll('.chips'), {
|
||||||
placeholder: 'Optional Tag',
|
placeholder: 'Optional Tag',
|
||||||
secondaryPlaceholder: 'Another Tag',
|
secondaryPlaceholder: 'Another Tag',
|
||||||
autocompleteOptions: {
|
autocompleteOptions: {
|
||||||
data: tags.concat(data.tags).reduce(function(result, item) {
|
data: external_data,
|
||||||
result[item] = null;
|
minLength: 0
|
||||||
return result;
|
},
|
||||||
}, {}),
|
onChipAdd: function(e, chip) {
|
||||||
limit: Infinity,
|
var $this = this;
|
||||||
minLength: 1
|
$this.chipsData.forEach(function(e, index) {
|
||||||
|
if(!(e.tag in external_data))
|
||||||
|
$this.deleteChip(index);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user