startService added again to fieldset

parent 58b67b90
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
// getContent of all subfields // getContent of all subfields
.declareMethod("getContent", function () { .declareMethod("getContent", function () {
console.log("GET CONTENT SIMPLE FIELDSET");
var i, promise_list = [], gadget = this; var i, promise_list = [], gadget = this;
for (i = 0; i < this.props.field_gadget_list.length; i += 1) { for (i = 0; i < this.props.field_gadget_list.length; i += 1) {
promise_list.push(this.props.field_gadget_list[i].getContent()); promise_list.push(this.props.field_gadget_list[i].getContent());
...@@ -149,8 +150,23 @@ ...@@ -149,8 +150,23 @@
} }
} }
} }
console.log("GET CONTENT SIMPLE FIELDSET 2");
console.log(result);
return result; return result;
}); });
})
.declareMethod('startService', function () {
console.log("startservice FIElDSET 1");
var gadget = this,
i,
promise_list = [];
for (i = 0; i < gadget.props.field_gadget_list.length; i += 1) {
if (gadget.props.field_gadget_list[i].startService) {
promise_list.push(gadget.props.field_gadget_list[i].startService());
}
}
console.log("there are " + promise_list.length + " subgadget promises");
return RSVP.all(promise_list);
}); });
}(window, rJS, RSVP, Handlebars, initGadgetMixin)); }(window, rJS, RSVP, Handlebars, initGadgetMixin));
...@@ -680,20 +680,27 @@ ...@@ -680,20 +680,27 @@
node_id)]); node_id)]);
}) })
.push(function (fieldset_gadget) { .push(function (fieldset_gadget) {
console.log(fieldset_gadget[0]);
return RSVP.Queue()
.push(function () {
console.log(fieldset_gadget[0]);
fieldset_gadget[0].startService();
})
.push(function () {
console.log(":::::::::::::::::::::::::::");
console.log(fieldset_gadget);
console.log(":::::::::::::::::::::::::::");
node_edit_popup.enhanceWithin(); node_edit_popup.enhanceWithin();
node_edit_popup.popup('open'); node_edit_popup.popup('open');
return fieldset_gadget[0]; return fieldset_gadget[0];
});
}) })
.push(function (fieldset_gadget) { .push(function (fieldset_gadget) {
// Expose the dialog handling promise so that we can wait for it in // Expose the dialog handling promise so that we can wait for it in
// test. // test.
console.log(":::::::::::::::::::2"); console.log("=======:::::::::::::::::::=======");
console.log(":::::::::::::::::::2");
console.log(":::::::::::::::::::2");
console.log(fieldset_gadget); console.log(fieldset_gadget);
console.log(":::::::::::::::::::2"); console.log("=======:::::::::::::::::::=======");
console.log(":::::::::::::::::::2");
console.log(":::::::::::::::::::2");
gadget.props.dialog_promise = RSVP.any([ gadget.props.dialog_promise = RSVP.any([
save_promise(fieldset_gadget, node_id), save_promise(fieldset_gadget, node_id),
delete_promise delete_promise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment