Skip to content
Snippets Groups Projects
Commit aa8a5ab9 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#187 - Add option to trigger cart by index

parent 5d5123b8
No related branches found
No related tags found
No related merge requests found
......@@ -8,17 +8,31 @@ module.exports = function (self) {
type: 'textinput',
label: 'Pad Name',
default: '',
required: false
},
{
id: 'index',
type: 'number',
label: 'Pad ID',
default: '',
required: false
},
],
callback: async (event) => {
if (event.options.name) {
const pad = self.currentProject.findPadByName(event.options.name);
if (!pad) {
self.log('warning', 'Cannot find a pad with name ' + event.options.name);
return;
}
self.sendToWebSocket('cart-action', {
'pad': pad.id
'padId': pad.id
});
} else if (event.options.index) {
self.sendToWebSocket('cart-action', {
'padIndex': event.options.index - 1
});
}
},
},
page_action: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment