Implement closing sidebar
This commit is contained in:
parent
ecbe27b373
commit
32645dd856
5 changed files with 29 additions and 1 deletions
|
@ -222,9 +222,11 @@ $(document).ready(function () {
|
||||||
initializeNotes(map);
|
initializeNotes(map);
|
||||||
|
|
||||||
OSM.Index = function(map) {
|
OSM.Index = function(map) {
|
||||||
var page = {};
|
var page = {}, minimized = false;
|
||||||
|
|
||||||
page.pushstate = page.popstate = function(path) {
|
page.pushstate = page.popstate = function(path) {
|
||||||
|
if (minimized) $("#sidebar").addClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
$("#view_tab").addClass("current");
|
$("#view_tab").addClass("current");
|
||||||
$('#sidebar_content').load(path);
|
$('#sidebar_content').load(path);
|
||||||
};
|
};
|
||||||
|
@ -233,6 +235,14 @@ $(document).ready(function () {
|
||||||
$("#view_tab").removeClass("current");
|
$("#view_tab").removeClass("current");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
page.minimizeSidebar = function() {
|
||||||
|
$("#sidebar").addClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
|
minimized = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).on("click", "#sidebar_content .close", page.minimizeSidebar);
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -240,6 +250,8 @@ $(document).ready(function () {
|
||||||
var page = {};
|
var page = {};
|
||||||
|
|
||||||
page.pushstate = page.popstate = function(path, type, id) {
|
page.pushstate = page.popstate = function(path, type, id) {
|
||||||
|
$("#sidebar").removeClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
$('#sidebar_content').load(path, function() {
|
$('#sidebar_content').load(path, function() {
|
||||||
page.load(path, type, id);
|
page.load(path, type, id);
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,6 +27,8 @@ OSM.ChangesetList = function(map) {
|
||||||
|
|
||||||
page.pushstate = page.popstate = function(path) {
|
page.pushstate = page.popstate = function(path) {
|
||||||
$("#history_tab").addClass("current");
|
$("#history_tab").addClass("current");
|
||||||
|
$("#sidebar").removeClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
$('#sidebar_content').load(path, page.load);
|
$('#sidebar_content').load(path, page.load);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ OSM.Export = function(map) {
|
||||||
|
|
||||||
page.pushstate = page.popstate = function(path) {
|
page.pushstate = page.popstate = function(path) {
|
||||||
$("#export_tab").addClass("current");
|
$("#export_tab").addClass("current");
|
||||||
|
$("#sidebar").removeClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
$('#sidebar_content').load(path, page.load);
|
$('#sidebar_content').load(path, page.load);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ OSM.Search = function(map) {
|
||||||
page.pushstate = page.popstate = function(path) {
|
page.pushstate = page.popstate = function(path) {
|
||||||
var params = querystring.parse(path.substring(path.indexOf('?') + 1));
|
var params = querystring.parse(path.substring(path.indexOf('?') + 1));
|
||||||
$("#query").val(params.query);
|
$("#query").val(params.query);
|
||||||
|
$("#sidebar").removeClass("minimized");
|
||||||
|
map.invalidateSize();
|
||||||
$("#sidebar_content").load(path, page.load);
|
$("#sidebar_content").load(path, page.load);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -590,6 +590,16 @@ nav.secondary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sidebar.minimized {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1000;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
#sidebar_content {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#map {
|
#map {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue