summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-07-28 18:06:45 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-09-11 17:55:17 +0200
commit1f13e56ac6813eef9649b055b240a470acf034c8 (patch)
tree66d76a6e4ed5cda822dd581175f12fab31e07820
parent01a8175119233a4de10dddaf74db5750ff6e0c25 (diff)
downloadfreeipa-1f13e56ac6813eef9649b055b240a470acf034c8.zip
freeipa-1f13e56ac6813eef9649b055b240a470acf034c8.tar.gz
freeipa-1f13e56ac6813eef9649b055b240a470acf034c8.tar.xz
webui: widget initialization
- used `ctor_init` instead of `init` to avoid name collision with existing logic - `ctor_init` is called right after widget instantiation. Basically support better inheritance for the old class system which doesn't have proper contructors https://fedorahosted.org/freeipa/ticket/4402 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
-rw-r--r--install/ui/src/freeipa/widget.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 986a3f4..e127343 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -213,6 +213,14 @@ IPA.widget = function(spec) {
};
/**
+ * Widget post constructor/factory initialization
+ *
+ * Called by builder by default.
+ */
+ that.ctor_init = function() {
+ };
+
+ /**
* Set enabled state.
* @param {boolean} value - True - enabled; False - disabled
*/
@@ -5998,6 +6006,7 @@ exp.post_op = function(obj, spec, context) {
nc.container = obj.widgets;
builder.build('widget', spec.widgets, nc);
}
+ if (obj.ctor_init) obj.ctor_init();
return obj;
};