Browse Source

HUE-5427 [fb] The drop functionality shouldn't refresh the page

Enrico Berti 9 years ago
parent
commit
230c87d
1 changed files with 12 additions and 12 deletions
  1. 12 12
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako

+ 12 - 12
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -1314,6 +1314,18 @@ from django.utils.translation import ugettext as _
 
           $("#moveForm").attr("action", "/filebrowser/move?next=${url('filebrowser.views.view', path='')}" + self.currentPath());
 
+          $('#moveForm').ajaxForm({
+            dataType:  'json',
+            success: function() {
+              $("#moveModal").modal('hide');
+              self.retrieveData();
+            },
+            error: function(xhr){
+              $.jHueNotify.error(xhr.responseText);
+              resetPrimaryButtonsStatus();
+            }
+          });
+
           if (mode === 'nomodal') {
             $.jHueNotify.info('${ _('Items moving to') } "' + $('#moveDestination').val() + '"');
             $("#moveForm").submit();
@@ -1323,18 +1335,6 @@ from django.utils.translation import ugettext as _
               show: true
             });
 
-            $('#moveForm').ajaxForm({
-              dataType:  'json',
-              success: function() {
-                $("#moveModal").modal('hide');
-                self.retrieveData();
-              },
-              error: function(xhr){
-                $.jHueNotify.error(xhr.responseText);
-                resetPrimaryButtonsStatus();
-              }
-            });
-
             $("#moveModal").on("shown", function () {
               $("#moveDestination").val('');
               $("#moveNameRequiredAlert").hide();