瀏覽代碼

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

Enrico Berti 9 年之前
父節點
當前提交
230c87d
共有 1 個文件被更改,包括 12 次插入12 次删除
  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();