mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Always redirect to My Files after upload
Summary: I've found it quite confusing that uploading a single image displays the image itself but uploading more images displays My Files. I've also got a user report about it because most users don't know that they can drop the image directly to the comment textarea and they are interested mainly in the ID of the uploaded file. Test Plan: Upload a file. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1891
This commit is contained in:
parent
efd6e087dc
commit
0553b32b37
2 changed files with 19 additions and 13 deletions
|
@ -662,7 +662,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-files-drag-and-drop' =>
|
||||
array(
|
||||
'uri' => '/res/0e84cc42/rsrc/js/application/core/behavior-files-drag-and-drop.js',
|
||||
'uri' => '/res/3a7a2a8a/rsrc/js/application/core/behavior-files-drag-and-drop.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -1146,6 +1146,17 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'disk' => '/rsrc/js/javelin/lib/Resource.js',
|
||||
),
|
||||
0 =>
|
||||
array(
|
||||
'uri' => '/res/b6096fdd/rsrc/js/javelin/lib/__tests__/URI.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
0 => 'javelin-uri',
|
||||
1 => 'javelin-php-serializer',
|
||||
),
|
||||
'disk' => '/rsrc/js/javelin/lib/__tests__/URI.js',
|
||||
),
|
||||
'javelin-stratcom' =>
|
||||
array(
|
||||
'uri' => '/res/3afdac66/rsrc/js/javelin/core/Stratcom.js',
|
||||
|
|
|
@ -35,20 +35,15 @@ JX.behavior('files-drag-and-drop', function(config) {
|
|||
|
||||
pending--;
|
||||
if (pending == 0) {
|
||||
// If whatever the user dropped in has finished uploading, either send
|
||||
// them to the file itself (if they uploaded only one) or to their
|
||||
// uploads (if they uploaded several).
|
||||
// If whatever the user dropped in has finished uploading, send them to
|
||||
// their uploads.
|
||||
var uri;
|
||||
if (files.length == 1) {
|
||||
uri = JX.$U(files[0].uri);
|
||||
} else {
|
||||
uri = JX.$U(config.browseURI);
|
||||
var ids = [];
|
||||
for (var ii = 0; ii < files.length; ii++) {
|
||||
ids.push(files[ii].id);
|
||||
}
|
||||
uri.setQueryParam('h', ids.join('-'));
|
||||
}
|
||||
|
||||
// Reset so if you hit 'back' into the bfcache the page is still in a
|
||||
// sensible state.
|
||||
|
|
Loading…
Reference in a new issue