From 0553b32b378a4a6c0de09ba7ba8de63ee50d96b6 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 13 Mar 2012 23:06:34 -0700 Subject: [PATCH] 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 --- src/__celerity_resource_map__.php | 13 ++++++++++++- .../core/behavior-files-drag-and-drop.js | 19 +++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 2a32824c11..4f15cf1b0c 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -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', diff --git a/webroot/rsrc/js/application/core/behavior-files-drag-and-drop.js b/webroot/rsrc/js/application/core/behavior-files-drag-and-drop.js index f85f0b616e..95146e59df 100644 --- a/webroot/rsrc/js/application/core/behavior-files-drag-and-drop.js +++ b/webroot/rsrc/js/application/core/behavior-files-drag-and-drop.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('-')); + 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.