Reuse styles for map-ui panel

This commit is contained in:
Tom MacWright 2013-06-13 12:15:43 -04:00 committed by John Firebaugh
parent 9172695f7f
commit e96a64ca9c
6 changed files with 29 additions and 14 deletions

View file

@ -123,6 +123,7 @@ function getShortUrl(map) {
function getUrl(map) { function getUrl(map) {
var center = map.getCenter(), var center = map.getCenter(),
zoom = map.getZoom(); zoom = map.getZoom();
return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ? return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
'http://openstreetmap.org/?' : '/?') + 'http://openstreetmap.org/?' : '/?') +
querystring.stringify({ querystring.stringify({

View file

@ -16,9 +16,11 @@ L.OSM.key = function (options) {
var $ui = $('<div>') var $ui = $('<div>')
.attr('class', 'layers-ui'); .attr('class', 'layers-ui');
$('<section>')
.appendTo($ui)
.append(
$('<h2>') $('<h2>')
.text(I18n.t('javascripts.key.title')) .text(I18n.t('javascripts.key.title')));
.appendTo($ui);
var $section = $('<section>') var $section = $('<section>')
.appendTo($ui); .appendTo($ui);

View file

@ -18,9 +18,11 @@ L.OSM.layers = function(options) {
var $ui = $('<div>') var $ui = $('<div>')
.attr('class', 'layers-ui'); .attr('class', 'layers-ui');
$('<section>')
.appendTo($ui)
.append(
$('<h2>') $('<h2>')
.text(I18n.t('javascripts.map.layers.header')) .text(I18n.t('javascripts.map.layers.header')));
.appendTo($ui);
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') { if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
var overlaySection = $('<section>') var overlaySection = $('<section>')

View file

@ -16,11 +16,13 @@ L.OSM.share = function (options) {
var $ui = $('<div>') var $ui = $('<div>')
.attr('class', 'share-ui'); .attr('class', 'share-ui');
$('<section>')
.appendTo($ui)
.append(
$('<h2>') $('<h2>')
.text(I18n.t('javascripts.share.title')) .text(I18n.t('javascripts.share.title')));
.appendTo($ui);
var $share_link = $('<div></div>') var $share_link = $('<section></section>')
.appendTo($ui); .appendTo($ui);
var $title = $('<h3></h3>') var $title = $('<h3></h3>')

View file

@ -22,7 +22,7 @@ L.OSM.sidebar = function(selector) {
current = $(); current = $();
} else { } else {
$(sidebar).show(); $(sidebar).show();
controlContainer.css({paddingRight: '200px'}); controlContainer.css({paddingRight: '250px'});
current = pane; current = pane;
} }

View file

@ -584,17 +584,26 @@ a.donate {
position: absolute; position: absolute;
display: none; display: none;
right: 0; right: 0;
width: 200px; width: 250px;
height: 100%; height: 100%;
background: white; background: white;
overflow: auto;
} }
.layers-ui { #map-ui {
section { section {
border-top: 1px solid #868e85; border-top: 1px solid #868e85;
padding: 15px; padding: 15px;
} }
section:first-child {
border-top:0;
}
h2 {
margin:0;
}
li { li {
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
@ -764,7 +773,6 @@ a.donate {
/* Rules for the map key which appears in the popout sidebar */ /* Rules for the map key which appears in the popout sidebar */
#mapkey { #mapkey {
padding: $lineheight $lineheight 0 $lineheight;
.mapkey-table-key img { .mapkey-table-key img {
display: block; display: block;
margin-left: auto; margin-left: auto;