1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Minor document rendering fixes: dropdown for synchronous files, URI normalization for default renderers

Summary:
Depends on D19258. Ref T13105.

  - When the default renderer is an Ajax renderer, don't replace the URI. For example, when viewing a Jupyter notebook, the URI should remain `/F123`, not instantly change to `/view/123/jupyter/`.
  - Fix an issue where non-ajax renderers could fail to display the dropdown menu properly.

Test Plan:
  - Viewed a Jupyter notebook, stayed on the same URI.
  - Changed rendering, got different URIs.
  - Viewed a JSON file and toggled renderers via dropdown.

Reviewers: mydeveloperday

Reviewed By: mydeveloperday

Maniphest Tasks: T13105

Differential Revision: https://secure.phabricator.com/D19259
This commit is contained in:
epriestley 2018-03-26 07:17:59 -07:00
parent 38999e25ac
commit b7d3101e7c
2 changed files with 12 additions and 9 deletions

View file

@ -392,7 +392,7 @@ return array(
'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'f01586dc', 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'f01586dc',
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '1db13e70', 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '1db13e70',
'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef',
'rsrc/js/application/files/behavior-document-engine.js' => 'd3f8623c', 'rsrc/js/application/files/behavior-document-engine.js' => '194cbe53',
'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab', 'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
'rsrc/js/application/harbormaster/behavior-harbormaster-log.js' => '191b4909', 'rsrc/js/application/harbormaster/behavior-harbormaster-log.js' => '191b4909',
@ -607,7 +607,7 @@ return array(
'javelin-behavior-diffusion-jump-to' => '73d09eef', 'javelin-behavior-diffusion-jump-to' => '73d09eef',
'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
'javelin-behavior-document-engine' => 'd3f8623c', 'javelin-behavior-document-engine' => '194cbe53',
'javelin-behavior-doorkeeper-tag' => '1db13e70', 'javelin-behavior-doorkeeper-tag' => '1db13e70',
'javelin-behavior-drydock-live-operation-status' => '901935ef', 'javelin-behavior-drydock-live-operation-status' => '901935ef',
'javelin-behavior-durable-column' => '2ae077e1', 'javelin-behavior-durable-column' => '2ae077e1',
@ -983,6 +983,11 @@ return array(
'191b4909' => array( '191b4909' => array(
'javelin-behavior', 'javelin-behavior',
), ),
'194cbe53' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
),
'1ad0a787' => array( '1ad0a787' => array(
'javelin-install', 'javelin-install',
'javelin-reactor', 'javelin-reactor',
@ -2002,11 +2007,6 @@ return array(
'd254d646' => array( 'd254d646' => array(
'javelin-util', 'javelin-util',
), ),
'd3f8623c' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
),
'd4505101' => array( 'd4505101' => array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-install', 'javelin-install',

View file

@ -73,7 +73,6 @@ JX.behavior('document-engine', function(config, statics) {
var handler = JX.bind(null, onrender, data, data.sequence); var handler = JX.bind(null, onrender, data, data.sequence);
data.viewKey = spec.viewKey; data.viewKey = spec.viewKey;
JX.History.replace(spec.viewURI);
new JX.Request(spec.engineURI, handler) new JX.Request(spec.engineURI, handler)
.send(); .send();
@ -91,6 +90,10 @@ JX.behavior('document-engine', function(config, statics) {
var load = JX.bind(null, onloading, data, spec); var load = JX.bind(null, onloading, data, spec);
data.loadTimer = setTimeout(load, 333); data.loadTimer = setTimeout(load, 333);
// Replace the URI with the URI for the specific rendering the user
// has selected.
JX.History.replace(spec.viewURI);
} }
} }
@ -128,7 +131,7 @@ JX.behavior('document-engine', function(config, statics) {
statics.initialized = true; statics.initialized = true;
} }
if (config.renderControlID) { if (config && config.renderControlID) {
var control = JX.$(config.renderControlID); var control = JX.$(config.renderControlID);
var data = JX.Stratcom.getData(control); var data = JX.Stratcom.getData(control);