1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-commit-branches.js
vrana 606ef34d61 Load commit branches and tags by AJAX
Summary:
Each query takes over 2 seconds in FBCODE.
I didn't find a way how to speed them up.
There's also no easy way how to parallelize them at least.
So AJAX is the last instance.

Test Plan: Loaded commit with one branch and no tag.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3112
2012-07-31 17:01:41 -07:00

19 lines
452 B
JavaScript

/**
* @provides javelin-behavior-diffusion-commit-branches
* @requires javelin-behavior
* javelin-dom
* javelin-util
* javelin-request
*/
JX.behavior('diffusion-commit-branches', function(config) {
for (var uri in config) {
JX.DOM.setContent(JX.$(config[uri]), 'Loading...');
new JX.Request(uri, JX.bind(config[uri], function(r) {
JX.DOM.setContent(JX.$(this), JX.$H(r));
})).send();
}
});