Add minimize() method to views
Change-Id: I2d55d0459374b678b5a4417701c9db9b57af8242
diff --git a/dev/js/src/view.js b/dev/js/src/view.js
index 7243837..27d1ab2 100644
--- a/dev/js/src/view.js
+++ b/dev/js/src/view.js
@@ -36,19 +36,20 @@
return this;
},
-
/**
* Element of the view
*/
element : function () {
- if (this._element)
+ if (this._element) {
+ this._element.classList.add('show');
return this._element;
+ };
// Create panel element
var e = document.createElement('div');
var cl = e.classList;
- cl.add('view');
+ cl.add('view', 'show');
if (this._classes)
cl.add.apply(cl, this._classes);
@@ -67,6 +68,7 @@
e.appendChild(this.actions.element());
this._element = e;
+
return e;
},
@@ -78,6 +80,16 @@
return this._shown;
},
+
+ /**
+ * Hide the widget if shown.
+ */
+ minimize : function () {
+ if (this._element) {
+ this._element.classList.remove("show");
+ }
+ },
+
// onClose : function () {},
/**