-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathDisable.ts
More file actions
31 lines (27 loc) · 847 Bytes
/
Disable.ts
File metadata and controls
31 lines (27 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Inline editor action to disable an object.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
import { InlineEditor } from "WoltLabSuite/Core/Component/Inline/Editor";
import { Simple } from "WoltLabSuite/Core/Component/Inline/Actions/Simple";
export class Disable extends Simple {
constructor(inlineEditor: InlineEditor, endpoint: string | URL) {
super(inlineEditor, "wcf.global.button.disable", endpoint);
}
responseOk(): void {
this.inlineEditor.update({
isDisabled: 1,
});
}
isVisible(): boolean {
return (
this.inlineEditor.getPermissions()["canEnable"] &&
!this.inlineEditor.getState("isDeleted") &&
!this.inlineEditor.getState("isDisabled")
);
}
}