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 years ago
parent
commit
6c2fcc1
1 changed files with 6 additions and 0 deletions
  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
     if (viewModel.totalPages() < viewModel.MAX_PAGES_TO_ENABLE_SCROLLING && viewModel.mode() == "text") { // enable scrolling
       _fileAreaScrollTimeout = -1;
       _fileAreaScrollTimeout = -1;
       $("#fileArea").on("scroll", function () {
       $("#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) {
         if ($("#fileArea").scrollTop() < 30) {
           viewModel.page(1);
           viewModel.page(1);
           viewModel.upperPage(viewModel.page());
           viewModel.upperPage(viewModel.page());