Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to plugin details tabs #317

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions qgis-app/plugins/templates/plugins/plugin_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,44 @@
});
});
});

// Handle URL anchor for tabs
$(window).load(function() {

// Store the current scroll position
var scrollPosition = 0;

// Handle tab clicks
$('.nav-tabs a').on('click', function (e) {
e.preventDefault();

// Store the current scroll position
scrollPosition = $(window).scrollTop();

// Update the URL without triggering a reload
window.location.hash = this.hash;

// Show the tab
$(this).tab('show');
});

// Restore the scroll position on tab change
$('.nav-tabs a').on('shown.bs.tab', function (e) {
$(window).scrollTop(scrollPosition);
});

// Activate the tab based on the URL fragment
var hash = window.location.hash;
if (hash) {
$('.nav-tabs a[href="' + hash + '"]').tab('show');
}

// Scroll to the top when the page loads
setTimeout(() => {
$(window).scrollTop(0);
})

});
</script>
{% endblock %}
{% block extracss %}
Expand Down
Loading