summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/phases.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-03-29 15:27:58 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:21 +0200
commit1b90b3b65ea214a3a09922f6b9c1de304e5257da (patch)
tree65693ef7db16618eb76c86e4848dd88c4582c172 /install/ui/src/freeipa/phases.js
parent344e15452a64ef9dc43a66a7e0085aef0eb7c175 (diff)
downloadfreeipa-1b90b3b65ea214a3a09922f6b9c1de304e5257da.tar.gz
freeipa-1b90b3b65ea214a3a09922f6b9c1de304e5257da.tar.xz
freeipa-1b90b3b65ea214a3a09922f6b9c1de304e5257da.zip
Add phase on exact position
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/phases.js')
-rw-r--r--install/ui/src/freeipa/phases.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/phases.js b/install/ui/src/freeipa/phases.js
index 15b753a0c..e5a23d07f 100644
--- a/install/ui/src/freeipa/phases.js
+++ b/install/ui/src/freeipa/phases.js
@@ -54,10 +54,39 @@ define([
controller: new Phase_controller(spec),
/**
- * Registers phase task
+ * Registers a phase task
+ *
+ * @param {String} Phase name
+ * @param {Function} Task handler. Should return promise if async.
+ * @param {Number} Priority of task. Default 10.
*/
on: function(phase_name, handler, priority) {
this.controller.add_task(phase_name, handler, priority);
+ },
+
+ /**
+ * Adds a phase
+ *
+ * Possible options:
+ * before: 'name-of-phase'
+ * after: 'name-of-phase'
+ * position: 'position for new phase'
+ *
+ * @param {String} Phase name
+ * @param {Object} Options
+ */
+ add: function(phase_name, options) {
+ this.controller.add_phase(phase_name, null, options);
+ },
+
+ /**
+ * Checks if phases with given name exists
+ *
+ * @param {String} Name
+ * @return {Boolean}
+ */
+ exists: function(name) {
+ return this.controller.exists(name);
}
};