Skip to content

Commit 555f736

Browse files
wip
1 parent 855dec0 commit 555f736

File tree

2 files changed

+36
-190
lines changed

2 files changed

+36
-190
lines changed

public/js/action-list.js

Lines changed: 0 additions & 190 deletions
This file was deleted.

public/js/module.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* Icinga DB Web | (c) 2024 Icinga GmbH | GPLv2 */
2+
3+
(function (Icinga, $) {
4+
5+
"use strict";
6+
7+
class IcingaDB {
8+
/**
9+
* Constructor
10+
*
11+
* @param {Icinga.Module} module
12+
*/
13+
constructor(module) {
14+
try {
15+
let Class = require("icinga/icinga-php-library/compat/ActionListBehavior");
16+
let behavior = new Class(module.icinga);
17+
module.icinga.behaviors[Class.name.toLowerCase()] = behavior;
18+
behavior.bind($(document));
19+
20+
Class = require("icinga/icinga-php-library/compat/LoadMoreBehavior");
21+
behavior = new Class(module.icinga);
22+
module.icinga.behaviors[Class.name.toLowerCase()] = behavior;
23+
behavior.bind($(document));
24+
25+
} catch (e) {
26+
console.warn('Unable to provide behaviors. Libraries not available:', e);
27+
return;
28+
}
29+
30+
this.icinga = module.icinga;
31+
}
32+
}
33+
34+
Icinga.availableModules.icingadb = IcingaDB;
35+
36+
})(Icinga, jQuery);

0 commit comments

Comments
 (0)