Commit b2706afe authored by Boris Kocherov's avatar Boris Kocherov

notifyChange send changed context now

parent 99b797d1
......@@ -656,9 +656,9 @@
})
.declareAcquiredMethod("resolveExternalReference", "resolveExternalReference")
.declareAcquiredMethod("notifyChange", "notifyChange")
.allowPublicAcquisition("rootNotifyChange", function () {
.allowPublicAcquisition("rootNotifyChange", function (arr, scope) {
this.props.changed = true;
return this.notifyChange();
return this.notifyChange(arr[0], scope);
})
.declareAcquiredMethod("notifyValid", "notifyValid")
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")
......
......@@ -635,6 +635,8 @@
return g.render(render_options);
})
.push(function () {
// XXX need path argument
// absent in current context
return gadget.rootNotifyChange();
});
},
......@@ -691,6 +693,8 @@
} else {
input.removeAttribute("style");
}
// XXX need path argument
// absent in current context
return gadget.rootNotifyChange();
});
},
......@@ -1740,7 +1744,14 @@
g.props = {};
g.options = {};
})
.declareAcquiredMethod("rootNotifyChange", "rootNotifyChange")
.declareAcquiredMethod("rNotifyChange", "rootNotifyChange")
.declareMethod("rootNotifyChange", function (path) {
var g = this;
return this.getJsonPath(path)
.push(function (p) {
return g.rNotifyChange(p);
});
})
.declareAcquiredMethod("selfRemove", "deleteChildren")
.allowPublicAcquisition("deleteChildren", function (arr, scope) {
var g = this,
......@@ -1923,13 +1934,13 @@
})
.allowPublicAcquisition("notifyChange", function (arr, sub_scope) {
var g = this,
opt = arr[0],
evt = arr[0],
event_object;
event_object = g.props.add_custom_data[sub_scope];
if (event_object && opt.type === "change") {
if (event_object && evt.type === "change") {
return event_object.event();
}
return g.rootNotifyChange();
return g.rootNotifyChange(evt.target.name);
})
.declareMethod('renderForm', function (options) {
var g = this,
......@@ -2048,7 +2059,7 @@
}
}
if (changed) {
return gadget.rootNotifyChange();
return gadget.rootNotifyChange(input.name);
}
})
......
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