瀏覽代碼

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 年之前
父節點
當前提交
6c2fcc1
共有 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());