LSP - delete triggers
This commit is contained in:
parent
182ec4656e
commit
3c409d4b42
2 changed files with 57 additions and 38 deletions
19
lsp/mist.js
19
lsp/mist.js
|
@ -3478,6 +3478,25 @@ var UI = {
|
|||
$('<button>').text('Edit').click(function(){
|
||||
UI.navto('Edit Trigger',$(this).closest('tr').attr('data-index'));
|
||||
})
|
||||
).append(
|
||||
$('<button>').text('Delete').click(function(){
|
||||
var index = $(this).closest('tr').attr('data-index').split(',');
|
||||
if (confirm('Are you sure you want to delete this '+index[0]+' trigger?')) {
|
||||
mist.data.config.triggers[index[0]].splice(index[1],1);
|
||||
if (mist.data.config.triggers[index[0]].length == 0) {
|
||||
delete mist.data.config.triggers[index[0]];
|
||||
}
|
||||
|
||||
var send = {
|
||||
config: {
|
||||
triggers: mist.data.config.triggers
|
||||
}
|
||||
};
|
||||
mist.send(function(d){
|
||||
UI.navto('Triggers');
|
||||
},send);
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue