diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2026-02-11 12:17:21 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2026-02-11 12:27:47 +0000 |
| commit | a30e37c58a183579ee217fbeb1370bc7dca7fc6b (patch) | |
| tree | 345ccc2a4cace26a93942810169bf614a095a3f6 /app | |
| parent | 568b28c165fb3d1e6102448e10e662b8691a8090 (diff) | |
| download | webtrees-a30e37c58a183579ee217fbeb1370bc7dca7fc6b.tar.gz webtrees-a30e37c58a183579ee217fbeb1370bc7dca7fc6b.tar.bz2 webtrees-a30e37c58a183579ee217fbeb1370bc7dca7fc6b.zip | |
Fix: #5044 - refactor the loading indicator for dynamically loaded content
Diffstat (limited to 'app')
| -rw-r--r-- | app/Module/ChartsBlockModule.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/app/Module/ChartsBlockModule.php b/app/Module/ChartsBlockModule.php index 4f00d7a743..fa123f7880 100644 --- a/app/Module/ChartsBlockModule.php +++ b/app/Module/ChartsBlockModule.php @@ -154,9 +154,10 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface $module = $this->module_service->findByInterface(InteractiveTreeModule::class)->first(); if ($module instanceof InteractiveTreeModule) { - $title = I18N::translate('Interactive tree of %s', $individual->fullName()); - $tv = new TreeView(); + $title = I18N::translate('Interactive tree of %s', $individual->fullName()); + $tv = new TreeView(); [$html, $js] = $tv->drawViewport($individual, 2); + $js = 'document.addEventListener("DOMContentLoaded", function() {' . $js . '});'; $content = $html . '<script>' . $js . '</script>'; } else { $title = I18N::translate('Interactive tree'); @@ -183,18 +184,6 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface } /** - * Should this block load asynchronously using AJAX? - * - * Simple blocks are faster in-line, more complex ones can be loaded later. - * - * @return bool - */ - public function loadAjax(): bool - { - return true; - } - - /** * Can this block be shown on the tree’s home page? * * @return bool |
