Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14076925
D19312.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D19312.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -390,7 +390,7 @@
'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'f01586dc',
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '1db13e70',
'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef',
- 'rsrc/js/application/files/behavior-document-engine.js' => 'ac52a3be',
+ 'rsrc/js/application/files/behavior-document-engine.js' => 'ed539253',
'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
'rsrc/js/application/harbormaster/behavior-harbormaster-log.js' => '191b4909',
@@ -604,7 +604,7 @@
'javelin-behavior-diffusion-jump-to' => '73d09eef',
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
- 'javelin-behavior-document-engine' => 'ac52a3be',
+ 'javelin-behavior-document-engine' => 'ed539253',
'javelin-behavior-doorkeeper-tag' => '1db13e70',
'javelin-behavior-drydock-live-operation-status' => '901935ef',
'javelin-behavior-durable-column' => '2ae077e1',
@@ -1764,11 +1764,6 @@
'javelin-dom',
'javelin-typeahead-normalizer',
),
- 'ac52a3be' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- ),
'acd29eee' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -2121,6 +2116,11 @@
'javelin-stratcom',
'javelin-vector',
),
+ 'ed539253' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ ),
'edf8a145' => array(
'javelin-behavior',
'javelin-uri',
diff --git a/webroot/rsrc/js/application/files/behavior-document-engine.js b/webroot/rsrc/js/application/files/behavior-document-engine.js
--- a/webroot/rsrc/js/application/files/behavior-document-engine.js
+++ b/webroot/rsrc/js/application/files/behavior-document-engine.js
@@ -151,7 +151,7 @@
}
data.sequence = (data.sequence || 0) + 1;
- var handler = JX.bind(null, onrender, data, data.sequence);
+ var handler = JX.bind(null, onrender, data, data.sequence, spec);
data.viewKey = spec.viewKey;
@@ -190,7 +190,7 @@
JX.DOM.setContent(viewport, JX.$H(spec.loadingMarkup));
}
- function onrender(data, sequence, r) {
+ function onrender(data, sequence, spec, r) {
// If this isn't the most recent request we sent, throw it away. This can
// happen if the user makes multiple selections from the menu while we are
// still rendering the first view.
@@ -209,19 +209,34 @@
data.loadingView = false;
JX.DOM.setContent(viewport, JX.$H(r.markup));
+
+ // If this engine supports rendering blame, populate or draw it.
+ if (spec.canBlame) {
+ blame(data);
+ }
}
function blame(data) {
+ // If the rendering engine can't handle blame, bail.
if (!data.blame.uri) {
return;
}
+ // If we already have an outstanding request for blame data, bail.
+ if (data.blame.request) {
+ return;
+ }
+
+ // If we don't have blame data yet, request it and then try rendering
+ // again later.
if (!data.blame.value) {
- new JX.Request(data.blame.uri, JX.bind(null, onblame, data))
- .send();
+ var req = new JX.Request(data.blame.uri, JX.bind(null, onblame, data));
+ data.blame.request = req;
+ req.send();
return;
}
+ // We're ready to render.
var viewport = JX.$(data.viewportID);
var cells = JX.DOM.scry(viewport, 'th');
@@ -253,6 +268,7 @@
}
function onblame(data, r) {
+ data.blame.request = null;
data.blame.value = r;
blame(data);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 8:23 PM (16 h, 19 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6775859
Default Alt Text
D19312.diff (3 KB)
Attached To
Mode
D19312: When you swap between document rendering engines, populate or redraw blame if appropriate
Attached
Detach File
Event Timeline
Log In to Comment