map controls and menus

This commit is contained in:
Nick Doiron
2016-05-06 12:20:56 -04:00
parent a9ee42bd94
commit 6bc9e63fc3
6 changed files with 15 additions and 10 deletions

View File

@@ -3537,6 +3537,10 @@ img.tile-removing {
border-radius: 0 0 4px 0;
}
[dir='rtl'] .geolocate-control button svg, [dir='rtl'] .list-item-gpx-browse svg {
transform: rotateY(180deg);
}
/* map control button overlays */
[dir='rtl'] .map-overlay {
padding: 20px 20px 20px 50px;

View File

@@ -150,7 +150,7 @@ export function uiBackground(context) {
.attr('class', 'best')
.call(tooltip()
.title(t('background.best_imagery'))
.placement('left'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.append('span')
.html('★');
@@ -337,7 +337,7 @@ export function uiBackground(context) {
var content = selection.append('div')
.attr('class', 'fillL map-overlay col3 content hide'),
tooltipBehavior = tooltip()
.placement('left')
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left')
.html(true)
.title(uiTooltipHtml(t('background.description'), key)),
button = selection.append('button')
@@ -369,7 +369,7 @@ export function uiBackground(context) {
.on('click.set-opacity', setOpacity)
.html('<div class="select-box"></div>')
.call(tooltip()
.placement('left'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.append('div')
.attr('class', 'opacity')
.style('opacity', function(d) { return 1.25 - d; });
@@ -388,7 +388,7 @@ export function uiBackground(context) {
.attr('class', 'layer-browse')
.call(tooltip()
.title(t('background.custom_button'))
.placement('left'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.on('click', editCustom)
.call(svgIcon('#icon-search'));

View File

@@ -54,6 +54,7 @@ export function uiGeolocate(context) {
.attr('title', t('geolocate.title'))
.on('click', click)
.call(svgIcon('#icon-geolocate', 'light'))
.call(tooltip().placement('left'));
.call(tooltip()
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'));
};
}

View File

@@ -113,7 +113,7 @@ export function uiHelp(context) {
var pane = selection.append('div')
.attr('class', 'help-wrap map-overlay fillL col5 content hide'),
tooltipBehavior = tooltip()
.placement('left')
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left')
.html(true)
.title(uiTooltipHtml(t('help.title'), key)),
button = selection.append('button')

View File

@@ -216,7 +216,7 @@ export function uiMapData(context) {
.attr('class', 'list-item-gpx-extent')
.call(tooltip()
.title(t('gpx.zoom'))
.placement('left'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.on('click', function() {
d3.event.preventDefault();
d3.event.stopPropagation();
@@ -229,7 +229,7 @@ export function uiMapData(context) {
.attr('class', 'list-item-gpx-browse')
.call(tooltip()
.title(t('gpx.browse'))
.placement('left'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.on('click', function() {
d3.select(document.createElement('input'))
.attr('type', 'file')
@@ -388,7 +388,7 @@ export function uiMapData(context) {
.append('div')
.attr('class', 'fillL map-overlay col3 content hide'),
tooltipBehavior = tooltip()
.placement('left')
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left')
.html(true)
.title(uiTooltipHtml(t('map_data.description'), key)),
button = selection

View File

@@ -57,7 +57,7 @@ export function uiZoom(context) {
.attr('class', function(d) { return d.id; })
.on('click.editor', function(d) { d.action(); })
.call(tooltip()
.placement('left')
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left')
.html(true)
.title(function(d) {
return uiTooltipHtml(d.title, d.key);