Commit 93ed8524 authored by Boris Kocherov's avatar Boris Kocherov

simplify selfRemove

parent 64584dbb
...@@ -696,16 +696,14 @@ ...@@ -696,16 +696,14 @@
event.srcElement.focus(); event.srcElement.focus();
}); });
}) })
.declareAcquiredMethod("deleteChildrenParent", "deleteChildren") .declareAcquiredMethod("selfRemove", "deleteChildren")
.allowPublicAcquisition("deleteChildren", function (scope) { .allowPublicAcquisition("deleteChildren", function (arr, scope) {
var g = this, var g = this,
key, key,
objects = this.props.objects, objects = this.props.objects,
element = getSubGadgetElement(this, scope), element = getSubGadgetElement(g, scope),
parent = element.getAttribute("data-json-parent"), parent = element.getAttribute("data-json-parent"),
tasks = []; tasks = [];
// TODO strange rjs behavior
scope = scope[0];
if (objects.hasOwnProperty(parent)) { if (objects.hasOwnProperty(parent)) {
parent = objects[parent]; parent = objects[parent];
for (key in parent) { for (key in parent) {
...@@ -724,9 +722,6 @@ ...@@ -724,9 +722,6 @@
} }
return RSVP.All(tasks); return RSVP.All(tasks);
}) })
.declareMethod("selfRemove", function () {
return this.deleteChildrenParent(this.element.getAttribute('data-gadget-scope'));
})
.declareAcquiredMethod("processValidationParent", "processValidation") .declareAcquiredMethod("processValidationParent", "processValidation")
.allowPublicAcquisition("processValidation", function (json_dict) { .allowPublicAcquisition("processValidation", function (json_dict) {
......
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