fix ajax sidebar

This commit is contained in:
Laura Klünder 2017-05-16 12:34:36 +02:00
parent 34a589c1cb
commit 7ba7affcfc
3 changed files with 6 additions and 6 deletions

View file

@ -44,7 +44,8 @@ body:not(.map-enabled) #sidebar {
width:100%;
}
#sidebar .content {
width:350px;
width:100%;
max-width:350px;
padding:10px 15px;
margin:auto;
}
@ -130,7 +131,6 @@ form button.invisiblesubmit {
width:100vw;
}
#sidebar .content {
width:100%;
max-width:500px;
}
body.show-map #sidebar {

View file

@ -68,9 +68,9 @@ editor = {
},
init_sidebar: function() {
// init the sidebar. sed listeners for form submits and link clicks
$('#sidebarcontent').on('click', 'a[href]', editor._sidebar_link_click)
.on('click', 'button[type=submit]', editor._sidebar_submit_btn_click)
.on('submit', 'form', editor._sidebar_submit);
$('#sidebar').find('.content').on('click', 'a[href]', editor._sidebar_link_click)
.on('click', 'button[type=submit]', editor._sidebar_submit_btn_click)
.on('submit', 'form', editor._sidebar_submit);
var location_path = editor.get_location_path();
editor.sidebar_get(location_path);
history.replaceState({}, '', location_path);
@ -80,7 +80,7 @@ editor = {
},
sidebar_get: function(location) {
// load a new page into the sidebar using a GET request
if ($('#sidebarcontent').html() !== '') {
if ($('#sidebar').find('.content').html() !== '') {
history.pushState({}, '', location);
}
editor._sidebar_unload();