Closed kiwi3685 closed 5 months ago
Can't reproduce on my local machine - but I can see it on another site.
We currently have the classes fade
and wt-ajax-load
(which creates the spinner) on the same <div>
.
Wonder if it would help to have nested <div>
elements with these classes on separate ones.
I can't get the nested div elements idea to work. I think thats because wt-ajax-load is dependant on the :empty css attribute, and fade is bootstrap javascript connected to the tab-pane class. They are therefore both dependant on the "target" element
However, to peserve the function of the "spinner", a work-around is to remove the "fade" class at the end of the javascript in individual-page-tabs.phtml, like this:
// Bootstrap tabs - load content dynamically using AJAX
$('a[data-bs-toggle="tab"][data-wt-href]').on('show.bs.tab', function () {
let target = $(this.hash + ':empty');
if (target.length > 0) {
// Start the download immediately...
let download = webtrees.httpGet(this.dataset.wtHref);
// ...but don't insert it until the tab is ready.
$(this).one('shown.bs.tab', () => {
download
.then(data => data.text())
.then(data => target.html(data))
.then(data => target.removeClass('fade'));
});
}
});
The spacing between the tabs and the tab-content is provided by each of the tab panels (using py-4
).
This means that empty tabs do not have the padding - but do have the spinner. Hence they are visible behind the active tab.
This design requires that all tabs specify the same padding.
A simpler option is to add the spacing to the tab-content
container using a margin (mt-4
).
Now, the spinner from the inactive tabs is behind the active tab, and not visible.
This allows us to use the fade
class - which is visually pleasing. It also puts the stying for the spacing in one place instead of several.
(The py-4
also appears to be creating an issue in #4996)
The only downside is that it would require third-party tabs to remove py-4
from their own templates.
Great, that's fixed #4996 as well. Just one small problem - you have removed the class .wt-page-options-value from the ul. Most themes use this for the background color of the sidebar. This is most evident in fullscreen mode. See screen shot of webtrees theme:
Re forum topics: INDI page load, and it's associated topic INDI page load (moved from Help with 2.1).
A more accurate title, in hindsight, would have been as I have used for this issue.
After considerable help from @ric2015, access to @mac.alter's site, and the creation of a simplified test installation, we have been able to identify the real problem described on the forum.
After elimination of as many variables as possible (different tabs, standard and custom code, browsers, operating systems etc, various facts became clear.
A search on Google found this report that identifies basically the same issue: https://github.com/twbs/bootstrap/issues/35361
So it is a Bootstrap issue. It relates to the use of the "fade" class on tabs. As described at the above link it can be best described as "If the fade animation is longer than the time between show/hide, the hide action will fail"
The simplest solution, in my view, is just to remove the "fade" class from all individual tabs, or at least those that utilise ajax loading.