Project

General

Profile

Actions

Bug #4836

closed

[Workbench] Ensure first tab content loads when shown, even if location hash indicated a different tab during initial page render

Added by Tom Clegg over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench
Target version:
Story points:
0.5

Description

These two links show me one collection in the Data collections tab.

However, if I load this page...

...the tab heading says "Data collections (1)" but when I click it, I get a table with name and description headings but no collections.

It looks like the "load content for collections table" trigger fires during initial page load (and only if that tab is active), and should also (instead?) fire when that tab/table is first exposed.


Subtasks 1 (0 open1 closed)

Task #4870: Review 4836-first-tab-load-wip and merge if goodResolvedBrett Smith01/05/2015Actions
Actions #1

Updated by Tom Clegg over 9 years ago

  • Description updated (diff)
  • Category set to Workbench
Actions #2

Updated by Brett Smith over 9 years ago

  • Assigned To set to Brett Smith
  • Target version changed from Bug Triage to 2015-01-07 sprint
Actions #3

Updated by Tom Clegg over 9 years ago

  • Status changed from New to In Progress
Actions #4

Updated by Tom Clegg over 9 years ago

At 3233ded:

Diagnosis makes sense, thank you.

However, I suspect the is(':visible') test is still needed. Even though it's no longer needed to prevent infinite-scroll content from going into the wrong div, it is needed to prevent infinite-scroll content from being loaded into an invisible div merely because it would have reached its load threshold if it were visible. For example, with 3233ded, I can do this:
  1. View my home project (lots of content on collections and jobs/pipelines tabs)
  2. Click the jobs/pipelines tab (first page of j/p loads)
  3. Click the collections tab (first page of collections loads)
  4. Scroll down
  5. The infinite scroll code notices I have scrolled beyond threshold for the j/p content, and (according to chrome network activity) loads another page of j/p. But this is a (probably) a waste of time, because I'm not even looking at that tab.
Would something like this address the issue, without causing invisible content to be loaded?
  • $(document).on('shown.bs.tab', function() {
        $('.infinite-scroller').trigger('scroll');
    });
    
Actions #5

Updated by Brett Smith over 9 years ago

Tom Clegg wrote:

Would something like this address the issue, without causing invisible content to be loaded?

That makes sense, thanks for catching that. Implemented with some additional bounds checking in ab6840d1. Ready for another look.

Actions #6

Updated by Tom Clegg over 9 years ago

ab6840d1 LGTM, thanks.

Actions #7

Updated by Brett Smith over 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:1a72b1b7b46d771129c1ec93221a5934fa33ef75.

Actions

Also available in: Atom PDF