Reset scroll position and selected tab in about dialog

(cherry picked from commit 4e84d62)
This commit is contained in:
Gina Häußge 2016-01-12 11:00:35 +01:00
parent e0b888b2d0
commit 3cc1c012bb
2 changed files with 12 additions and 2 deletions

View file

@ -3,8 +3,12 @@ $(function() {
var self = this;
self.aboutDialog = undefined;
self.aboutContent = undefined;
self.aboutTabs = undefined;
self.show = function() {
$("a:first", self.aboutTabs).tab("show");
self.aboutContent.scrollTop(0);
self.aboutDialog.modal({
minHeight: function() { return Math.max($.fn.modal.defaults.maxHeight() - 80, 250); }
}).css({
@ -19,7 +23,13 @@ $(function() {
};
self.onStartup = function() {
self.aboutDialog = $('#about_dialog');
self.aboutDialog = $("#about_dialog");
self.aboutTabs = $("#about_dialog_tabs");
self.aboutContent = $("#about_dialog_content");
$('a[data-toggle="tab"]', self.aboutTabs).on("show", function() {
self.aboutContent.scrollTop(0);
});
};
}

View file

@ -7,7 +7,7 @@
<div class="full-sized-box">
<div class="tabbable row-fluid">
<div class="span3 scrollable" id="about_dialog_menu">
<ul class="nav nav-list" id="aboutTabs">
<ul class="nav nav-list" id="about_dialog_tabs">
{% set mark_active = True %}
{% for key in templates.about.order %}
{% set entry, data = templates.about.entries[key] %}