1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 09:48:47 +02:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-pull-lastmodified.js
epriestley df59f4b047 Batch all supplementary information in Diffusion browse views
Summary: Ref T2683. Instead of sending one request for each path's history, send one request for all of it. This permits optimizations which are not currently available to us. It degrades the user experience a tiny bit in theory, but on my machine it's actually way faster already.

Test Plan: Loaded a browse page.

Reviewers: vrana, btrahan

Reviewed By: btrahan

Subscribers: epriestley, aran

Maniphest Tasks: T2683

Differential Revision: https://secure.phabricator.com/D5254
2014-05-12 11:47:26 -07:00

22 lines
544 B
JavaScript

/**
* @provides javelin-behavior-diffusion-pull-lastmodified
* @requires javelin-behavior
* javelin-dom
* javelin-util
* javelin-workflow
* javelin-json
*/
JX.behavior('diffusion-pull-lastmodified', function(config) {
new JX.Workflow(config.uri, {paths: JX.JSON.stringify(JX.keys(config.map))})
.setHandler(function(r) {
for (var k in r) {
for (var l in r[k]) {
JX.DOM.setContent(JX.$(config.map[k][l]), JX.$H(r[k][l]));
}
}
})
.start();
});