update RTL detection

This commit is contained in:
Nick Doiron
2016-09-22 14:20:00 -04:00
parent e208300ca5
commit 581bade5f3
14 changed files with 58 additions and 40 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import * as d3 from 'd3';
import _ from 'lodash';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { t } from '../util/locale';
import { t, textDirection } from '../util/locale';
import { svgIcon } from '../svg/index';
import { uiTooltipHtml } from './tooltipHtml';
import { tooltip } from '../util/tooltip';
@@ -216,7 +216,7 @@ export function uiMapData(context) {
.attr('class', 'list-item-gpx-extent')
.call(tooltip()
.title(t('gpx.zoom'))
.placement((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.placement((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((iD.detect().textDirection === 'rtl') ? 'right' : 'left'))
.placement((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((iD.detect().textDirection === 'rtl') ? 'right' : 'left')
.placement((textDirection === 'rtl') ? 'right' : 'left')
.html(true)
.title(uiTooltipHtml(t('map_data.description'), key)),
button = selection