1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 17:30:59 +01:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-load-blame.js
vrana e57f209056 Load blame in Diffusion by AJAX
Summary:
I have blame enabled by default and displaying files with long history takes easily over 10 seconds.
Load the blame data by AJAX instead.
This is actually doing more work and the total response time is longer but it's worth it for me as I am interested just in the file contents quite often.

I know you were talking about building blame cache but until we have it...

I'm not sure if the AJAX loading indicator in bottom right corner is enough to inform the user that we are loading it on background.

Test Plan:
?view=highlighted
?view=plainblame
?view=blame

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5244
2013-03-06 07:44:45 -08:00

14 lines
309 B
JavaScript

/**
* @provides javelin-behavior-load-blame
* @requires javelin-behavior
* javelin-dom
* javelin-request
*/
JX.behavior('load-blame', function(config) {
new JX.Request(location.href, function (response) {
JX.DOM.setContent(JX.$(config.id), JX.$H(response));
}).send();
});