Fix DS settings sidebar moving incorrectly

This commit is contained in:
Ryan Huffman 2017-10-27 11:05:23 -07:00
parent 2944d76ef0
commit 390dae3918
4 changed files with 21 additions and 4 deletions

View file

@ -89,11 +89,13 @@
{
"name": "description",
"label": "Description",
"advanced": true,
"help": "A description of your domain (256 character limit)."
},
{
"name": "maturity",
"label": "Maturity",
"advanced": true,
"help": "A maturity rating, available as a guideline for content on your domain.",
"default": "unrated",
"type": "select",
@ -123,6 +125,7 @@
{
"name": "hosts",
"label": "Hosts",
"advanced": true,
"type": "table",
"can_add_new_rows": true,
"help": "Usernames of hosts who can reliably show your domain to new visitors.",
@ -138,6 +141,7 @@
{
"name": "tags",
"label": "Tags",
"advanced": true,
"type": "table",
"can_add_new_rows": true,
"help": "Common categories under which your domain falls.",

View file

@ -81,8 +81,10 @@ span.port {
}
#setup-sidebar.affix {
position: fixed;
top: 70px;
/* This overrides a case where going to the bottom of the page,
* then scrolling up, causes `position: relative` to be added to the style
*/
position: fixed !important;
}
#setup-sidebar button {

View file

@ -9,7 +9,7 @@
<div class="row">
<div class="col-md-3 col-sm-3" id="setup-sidebar-col">
<div id="setup-sidebar" class="hidden-xs" data-spy="affix" data-offset-top="1" data-clampedwidth="#setup-sidebar-col">
<div id="setup-sidebar" data-clampedwidth="#setup-sidebar-col">
<script id="list-group-template" type="text/template">
<% _.each(descriptions, function(group){ %>
<% panelID = group.name ? group.name : group.html_id %>

View file

@ -297,7 +297,14 @@ $(document).ready(function(){
var sidebarTemplate = $('#list-group-template').html()
Settings.sidebarTemplate = _.template(sidebarTemplate)
// $('body').scrollspy({ target: '#setup-sidebar'})
var navbarHeight = $('.navbar').outerHeight(true);
$('#setup-sidebar').affix({
offset: {
top: 1,
bottom: navbarHeight
}
});
reloadSettings(function(success){
if (success) {
@ -309,6 +316,10 @@ $(document).ready(function(){
text: Strings.LOADING_SETTINGS_ERROR
});
}
$('body').scrollspy({
target: '#setup-sidebar',
offset: navbarHeight
});
});
});