Browse Source

HUE-2319 [fb] Do not offer file scrolling when offsets are not supported

Added check to fileArea scroll event that tests if compression type is 'gzip', disables navigation and displays warning message.
Paul McCaughtry 11 năm trước cách đây
mục cha
commit
6c2fcc1
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      apps/filebrowser/src/filebrowser/templates/display.mako

+ 6 - 0
apps/filebrowser/src/filebrowser/templates/display.mako

@@ -436,6 +436,12 @@ ${ fb_components.menubar() }
     if (viewModel.totalPages() < viewModel.MAX_PAGES_TO_ENABLE_SCROLLING && viewModel.mode() == "text") { // enable scrolling
       _fileAreaScrollTimeout = -1;
       $("#fileArea").on("scroll", function () {
+        if (viewModel.compression() === 'gzip') {
+          $("#fileArea").off("scroll");
+          $(document).trigger('warn', "${_('Offsets are not supported with Gzip compression.')}");
+          return false;
+        }
+
         if ($("#fileArea").scrollTop() < 30) {
           viewModel.page(1);
           viewModel.upperPage(viewModel.page());