Support descriptions in plugin embeds (fixes #224)
Change-Id: I65f15113c08d464d6eef2af1186e1ebfa7dab225
diff --git a/dev/js/src/plugin/server.js b/dev/js/src/plugin/server.js
index ecf436c..c99f695 100644
--- a/dev/js/src/plugin/server.js
+++ b/dev/js/src/plugin/server.js
@@ -205,7 +205,10 @@
// Button object
- let obj = {'cls':embed["classes"], 'icon': icon }
+ let obj = {'cls':embed["classes"], 'icon': icon };
+
+ if (embed['desc'] != undefined)
+ obj['desc'] = embed['desc'];
if (onClick["action"] && onClick["action"] == "setWidget") {
@@ -231,7 +234,6 @@
}
}
- // TODO There is no possibility to add icons to a plugin toggle button right now.
else if (onClick["action"] == "toggle") {
// TODO:
@@ -244,9 +246,14 @@
onClick["default"]
);
+ let obj = {'cls':["title"], 'icon': icon};
+
+ if (embed['desc'] != undefined)
+ obj['desc'] = embed['desc'];
+
// TODO:
// Lazy registration (see above!)
- KorAP.Panel[panel].actions().addToggle(title, {'cls':["title"]}, state);
+ KorAP.Panel[panel].actions().addToggle(title, obj, state);
// Add the service
let id = this.addService({