Explorar el Código

HUE-6824 [fb] Fix possible JS error after permanently deleting files

Enrico Berti hace 8 años
padre
commit
915bd3e

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

@@ -1676,9 +1676,11 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
               });
               });
               var $scrollable = $(window);
               var $scrollable = $(window);
               %if is_embeddable:
               %if is_embeddable:
-                $scrollable = $('.page-content');
+              $scrollable = $('.page-content');
               %endif
               %endif
-              $scrollable.scrollTop($('.row-deleted:eq(0)').offset().top - 150);
+              if ($('.row-deleted').length() > 0 && $('.row-deleted:eq(0)').offset()) {
+                $scrollable.scrollTop($('.row-deleted:eq(0)').offset().top - 150);
+              }
             }, 500);
             }, 500);
             window.setTimeout(function(){
             window.setTimeout(function(){
               $(self.selectedFiles()).each(function (index, file) {
               $(self.selectedFiles()).each(function (index, file) {