Pass a name to widgets
Change-Id: I1ac7096d263f860f5c5c80115bfd07f8cbe40c0f
diff --git a/dev/js/src/plugin/widget.js b/dev/js/src/plugin/widget.js
index 1fe417a..338faa3 100644
--- a/dev/js/src/plugin/widget.js
+++ b/dev/js/src/plugin/widget.js
@@ -19,12 +19,13 @@
/**
* Create new widget
*/
- create : function (src, id) {
- return Object.create(this)._init(src, id);
+ create : function (name, src, id) {
+ return Object.create(this)._init(name, src, id);
},
// Initialize widget
- _init : function (src, id) {
+ _init : function (name, src, id) {
+ this.name = name;
this.src = src;
this.id = id;
return this;
@@ -60,6 +61,12 @@
close.classList.add('close');
close.setAttribute('title', loc.CLOSE);
+ // Add info button on plugin
+ var plugin = ul.addE('li');
+ plugin.addE('span').addT(this.name);
+ plugin.classList.add('plugin');
+ plugin.setAttribute('title', this.name);
+
// Close match
close.addEventListener('click', function (e) {
e.halt();