Преглед изворни кода

HUE-837 [fb] Clicking on upload button sends to /

Fixed a bug with location.hash change on dialog show (upload and create folder)
Enrico Berti пре 13 година
родитељ
комит
7494a2c69c
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako

+ 5 - 2
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -445,8 +445,11 @@ from django.utils.translation import ugettext as _
             });
 
             $(window).bind("hashchange", function() {
-                viewModel.targetPath("${url('filebrowser.views.view', path=urlencode('/'))}" + window.location.hash.substring(2));
-                viewModel.retrieveData();
+                var hash = window.location.hash.substring(2);
+                if (hash != null && hash != "") {
+                    viewModel.targetPath("${url('filebrowser.views.view', path=urlencode('/'))}" + hash);
+                    viewModel.retrieveData();
+                }
             });