* Remove an existing action. * * @param {String} actionName Name of the action * @param {String} actionId ID of the action * @returns boolean indicating the presence of the action.
(actionName: string, actionId: string)
| 495 | * @returns boolean indicating the presence of the action. |
| 496 | */ |
| 497 | removeAction(actionName: string, actionId: string): boolean { |
| 498 | const action = this.getAction(actionName, actionId); |
| 499 | if (action === null) { |
| 500 | return false; |
| 501 | } |
| 502 | |
| 503 | action.cancel(); |
| 504 | for (let i = 0; i < this.actions[actionName].length; ++i) { |
| 505 | if (this.actions[actionName][i].getId() === actionId) { |
| 506 | this.actions[actionName].splice(i, 1); |
| 507 | break; |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | return true; |
| 512 | } |
| 513 | |
| 514 | /** |
| 515 | * Add an available action. |