mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 06:50:55 +01:00
d2954dae40
Summary: When a JX.Request fails, there's no default error handling. Rather than write some kind of custom stuff, just use JX.Workflow so we get exception dialogs. We have plans to enhance these anyway (see T302). Test Plan: Changed the changeset view controller to throw exceptions. Verified I got un-mysterious exception dialogs when a changeset failed because of an exception in either initial rendering or after hitting "see more". Reviewed By: tomo Reviewers: jungejason, tuomaspelkonen, aran, tomo CC: aran, epriestley, tomo Differential Revision: 679
26 lines
566 B
JavaScript
26 lines
566 B
JavaScript
/**
|
|
* @provides javelin-behavior-differential-populate
|
|
* @requires javelin-behavior
|
|
* javelin-workflow
|
|
* javelin-util
|
|
* javelin-dom
|
|
*/
|
|
|
|
JX.behavior('differential-populate', function(config) {
|
|
|
|
function onresponse(target, response) {
|
|
JX.DOM.replace(JX.$(target), JX.$H(response));
|
|
}
|
|
|
|
for (var k in config.registry) {
|
|
var data = {
|
|
ref : config.registry[k],
|
|
whitespace: config.whitespace
|
|
};
|
|
|
|
new JX.Workflow(config.uri, data)
|
|
.setHandler(JX.bind(null, onresponse, k))
|
|
.start();
|
|
}
|
|
|
|
});
|