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

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 година
родитељ
комит
6c2fcc13da
1 измењених фајлова са 6 додато и 0 уклоњено
  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());