import SpacedUpdate from "../../services/spaced_update.js"; import AbstractAction from "./abstract_action.js"; const TPL = ` Delete label:
Label name:
`; export default class DeleteLabelSearchAction extends AbstractAction { static get actionName() { return "deleteLabel"; } doRender() { const $action = $(TPL); const $labelName = $action.find('.label-name'); $labelName.val(this.actionDef.labelName || ""); const spacedUpdate = new SpacedUpdate(async () => { await this.saveAction({ labelName: $labelName.val() }); }, 1000) $labelName.on('input', () => spacedUpdate.scheduleUpdate()); return $action; } }