Bug #4836
closed[Workbench] Ensure first tab content loads when shown, even if location hash indicated a different tab during initial page render
Description
These two links show me one collection in the Data collections tab.
- https://workbench.4xphq.arvadosapi.com/projects/4xphq-j7d0g-o65lwls3n5duo62
- https://workbench.4xphq.arvadosapi.com/projects/4xphq-j7d0g-o65lwls3n5duo62#Data_collections
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.
Updated by Tom Clegg about 10 years ago
- Description updated (diff)
- Category set to Workbench
Updated by Brett Smith about 10 years ago
- Assigned To set to Brett Smith
- Target version changed from Bug Triage to 2015-01-07 sprint
Updated by Tom Clegg about 10 years ago
At 3233ded:
Diagnosis makes sense, thank you.
However, I suspect theis(':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:
- View my home project (lots of content on collections and jobs/pipelines tabs)
- Click the jobs/pipelines tab (first page of j/p loads)
- Click the collections tab (first page of collections loads)
- Scroll down
- 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.
$(document).on('shown.bs.tab', function() { $('.infinite-scroller').trigger('scroll'); });
Updated by Brett Smith about 10 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.
Updated by Brett Smith about 10 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:1a72b1b7b46d771129c1ec93221a5934fa33ef75.