diff --git a/css/80_app.css b/css/80_app.css index 637747d24..4bfc9aedf 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -5084,53 +5084,6 @@ svg.mouseclick use.right { background-color: #fff; } -.tail { - width: 200px; - height: 400px; - pointer-events: none; - opacity: .8; - margin-top: -200px; - position: absolute; - background: transparent; -} -.tail::after { - content: ""; - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - top: 50%; - right: -5px; - margin-top: -5px; - border-left-color: #fff; - border-width: 5px 0 5px 5px; -} - -.tail div { - border-radius: 3px; - padding: 10px; - background: #fff; - position: absolute; - top: 180px; - left: 0; - right: 0; - margin: auto; -} - -.left.tail::after { - content: ""; - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - top: 50%; - left: -5px; - margin-top: -5px; - border-right-color: #fff; - border-width: 5px 5px 5px 0; -} .popover-arrow { position: absolute; width: 0; diff --git a/data/core.yaml b/data/core.yaml index 1790983e8..20ac2c286 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -33,33 +33,25 @@ en: add_area: title: Area description: "Add parks, buildings, lakes or other areas to the map." - tail: "Click on the map to start drawing an area, like a park, lake, or building." filter_tooltip: areas add_line: title: Line description: "Add highways, streets, pedestrian paths, canals or other lines to the map." - tail: "Click on the map to start drawing a road, path, or route." filter_tooltip: lines add_point: title: Point description: "Add restaurants, monuments, postal boxes or other points to the map." - tail: Click on the map to add a point. filter_tooltip: points add_note: title: Note label: Add Note description: "Spotted an issue? Let other mappers know." - tail: Click on the map to add a note. key: N add_preset: title: "Add {feature}" browse: title: Browse description: Pan and zoom the map. - draw_area: - tail: Click to add nodes to your area. Click the first node to finish the area. - draw_line: - tail: "Click to add more nodes to the line. Click on other lines to connect to them, and double-click to end the line." drag_node: connected_to_hidden: This can't be edited because it is connected to a hidden feature. operations: diff --git a/dist/locales/en.json b/dist/locales/en.json index 7f3e70d25..59b49b4d9 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -39,26 +39,22 @@ "add_area": { "title": "Area", "description": "Add parks, buildings, lakes or other areas to the map.", - "tail": "Click on the map to start drawing an area, like a park, lake, or building.", "filter_tooltip": "areas" }, "add_line": { "title": "Line", "description": "Add highways, streets, pedestrian paths, canals or other lines to the map.", - "tail": "Click on the map to start drawing a road, path, or route.", "filter_tooltip": "lines" }, "add_point": { "title": "Point", "description": "Add restaurants, monuments, postal boxes or other points to the map.", - "tail": "Click on the map to add a point.", "filter_tooltip": "points" }, "add_note": { "title": "Note", "label": "Add Note", "description": "Spotted an issue? Let other mappers know.", - "tail": "Click on the map to add a note.", "key": "N" }, "add_preset": { @@ -68,12 +64,6 @@ "title": "Browse", "description": "Pan and zoom the map." }, - "draw_area": { - "tail": "Click to add nodes to your area. Click the first node to finish the area." - }, - "draw_line": { - "tail": "Click to add more nodes to the line. Click on other lines to connect to them, and double-click to end the line." - }, "drag_node": { "connected_to_hidden": "This can't be edited because it is connected to a hidden feature." } diff --git a/modules/behavior/add_way.js b/modules/behavior/add_way.js index a4b0461ae..9479ca8da 100644 --- a/modules/behavior/add_way.js +++ b/modules/behavior/add_way.js @@ -37,11 +37,5 @@ export function behaviorAddWay(context) { }; - behavior.tail = function(text) { - draw.tail(text); - return behavior; - }; - - return utilRebind(behavior, dispatch, 'on'); } diff --git a/modules/behavior/draw.js b/modules/behavior/draw.js index 736d09f7c..7810a76c6 100644 --- a/modules/behavior/draw.js +++ b/modules/behavior/draw.js @@ -8,11 +8,9 @@ import { import { presetManager } from '../presets'; import { behaviorEdit } from './edit'; import { behaviorHover } from './hover'; -import { behaviorTail } from './tail'; import { geoChooseEdge, geoVecLength } from '../geo'; import { utilFastMouse, utilKeybinding, utilRebind } from '../util'; -var _usedTails = {}; var _disableSpace = false; var _lastSpace = null; @@ -26,7 +24,6 @@ export function behaviorDraw(context) { var _hover = behaviorHover(context).altDisables(true).ignoreVertex(true) .on('hover', context.ui().sidebar.hover); - var tail = behaviorTail(); var edit = behaviorEdit(context); var closeTolerance = 4; @@ -201,10 +198,6 @@ export function behaviorDraw(context) { context.install(_hover); context.install(edit); - if (!context.inIntro() && !_usedTails[tail.text()]) { - context.install(tail); - } - keybinding .on('⌫', backspace) .on('⌦', del) @@ -231,11 +224,6 @@ export function behaviorDraw(context) { context.uninstall(_hover); context.uninstall(edit); - if (!context.inIntro() && !_usedTails[tail.text()]) { - context.uninstall(tail); - _usedTails[tail.text()] = true; - } - selection .on('mouseenter.draw', null) .on('mouseleave.draw', null) @@ -251,11 +239,6 @@ export function behaviorDraw(context) { }; - behavior.tail = function(_) { - tail.text(_); - return behavior; - }; - behavior.hover = function() { return _hover; }; diff --git a/modules/behavior/draw_way.js b/modules/behavior/draw_way.js index b5ea78ed9..ad0687106 100644 --- a/modules/behavior/draw_way.js +++ b/modules/behavior/draw_way.js @@ -428,11 +428,5 @@ export function behaviorDrawWay(context, wayID, index, mode, startGraph) { }; - drawWay.tail = function(text) { - behavior.tail(text); - return drawWay; - }; - - return utilRebind(drawWay, dispatch, 'on'); } diff --git a/modules/behavior/index.js b/modules/behavior/index.js index 2dfb951bf..054dbb6cf 100644 --- a/modules/behavior/index.js +++ b/modules/behavior/index.js @@ -11,4 +11,3 @@ export { behaviorLasso } from './lasso'; export { behaviorOperation } from './operation'; export { behaviorPaste } from './paste'; export { behaviorSelect } from './select'; -export { behaviorTail } from './tail'; diff --git a/modules/behavior/tail.js b/modules/behavior/tail.js deleted file mode 100644 index 3d30c1ba9..000000000 --- a/modules/behavior/tail.js +++ /dev/null @@ -1,99 +0,0 @@ -import { - event as d3_event, - select as d3_select -} from 'd3-selection'; - -import { utilSetTransform } from '../util'; -import { utilGetDimensions } from '../util/dimensions'; - - -export function behaviorTail() { - var container; - var xmargin = 25; - var tooltipSize = [0, 0]; - var selectionSize = [0, 0]; - var _text; - - - function behavior(selection) { - if (!_text) return; - - d3_select(window) - .on('resize.tail', function() { selectionSize = utilGetDimensions(selection); }); - - container = d3_select(document.body) - .append('div') - .style('display', 'none') - .attr('class', 'tail popover-inner'); - - container.append('div') - .text(_text); - - selection - .on('mousemove.tail', mousemove) - .on('mouseenter.tail', mouseenter) - .on('mouseleave.tail', mouseleave); - - container - .on('mousemove.tail', mousemove); - - tooltipSize = utilGetDimensions(container); - selectionSize = utilGetDimensions(selection); - - - function show() { - container.style('display', 'block'); - tooltipSize = utilGetDimensions(container); - } - - - function mousemove() { - if (container.style('display') === 'none') show(); - var xoffset = ((d3_event.clientX + tooltipSize[0] + xmargin) > selectionSize[0]) ? - -tooltipSize[0] - xmargin : xmargin; - container.classed('left', xoffset > 0); - utilSetTransform(container, d3_event.clientX + xoffset, d3_event.clientY); - } - - - function mouseleave() { - if (d3_event.relatedTarget !== container.node()) { - container.style('display', 'none'); - } - } - - - function mouseenter() { - if (d3_event.relatedTarget !== container.node()) { - show(); - } - } - } - - - behavior.off = function(selection) { - if (!_text) return; - - container - .on('mousemove.tail', null) - .remove(); - - selection - .on('mousemove.tail', null) - .on('mouseenter.tail', null) - .on('mouseleave.tail', null); - - d3_select(window) - .on('resize.tail', null); - }; - - - behavior.text = function(val) { - if (!arguments.length) return _text; - _text = val; - return behavior; - }; - - - return behavior; -} diff --git a/modules/modes/add_area.js b/modules/modes/add_area.js index 446639808..499c4b3b1 100644 --- a/modules/modes/add_area.js +++ b/modules/modes/add_area.js @@ -12,7 +12,6 @@ export function modeAddArea(context, mode) { mode.id = 'add-area'; var behavior = behaviorAddWay(context) - .tail(t('modes.add_area.tail')) .on('start', start) .on('startFromWay', startFromWay) .on('startFromNode', startFromNode); diff --git a/modules/modes/add_line.js b/modules/modes/add_line.js index 00b5e77fb..5db5913d5 100644 --- a/modules/modes/add_line.js +++ b/modules/modes/add_line.js @@ -12,7 +12,6 @@ export function modeAddLine(context, mode) { mode.id = 'add-line'; var behavior = behaviorAddWay(context) - .tail(t('modes.add_line.tail')) .on('start', start) .on('startFromWay', startFromWay) .on('startFromNode', startFromNode); diff --git a/modules/modes/add_note.js b/modules/modes/add_note.js index 6bb89f87e..b257663cd 100644 --- a/modules/modes/add_note.js +++ b/modules/modes/add_note.js @@ -16,7 +16,6 @@ export function modeAddNote(context) { }; var behavior = behaviorDraw(context) - .tail(t('modes.add_note.tail')) .on('click', add) .on('cancel', cancel) .on('finish', cancel); diff --git a/modules/modes/add_point.js b/modules/modes/add_point.js index c17064aaa..3ad4a301b 100644 --- a/modules/modes/add_point.js +++ b/modules/modes/add_point.js @@ -13,7 +13,6 @@ export function modeAddPoint(context, mode) { mode.id = 'add-point'; var behavior = behaviorDraw(context) - .tail(t('modes.add_point.tail')) .on('click', add) .on('clickWay', addWay) .on('clickNode', addNode) diff --git a/modules/modes/draw_area.js b/modules/modes/draw_area.js index cc8bdf118..7c050aba5 100644 --- a/modules/modes/draw_area.js +++ b/modules/modes/draw_area.js @@ -16,7 +16,6 @@ export function modeDrawArea(context, wayID, startGraph, button) { var way = context.entity(wayID); behavior = behaviorDrawWay(context, wayID, undefined, mode, startGraph) - .tail(t('modes.draw_area.tail')) .on('rejectedSelfIntersection.modeDrawArea', function() { context.ui().flash .text(t('self_intersection.error.areas'))(); diff --git a/modules/modes/draw_line.js b/modules/modes/draw_line.js index cf5d41be2..63dbc504d 100644 --- a/modules/modes/draw_line.js +++ b/modules/modes/draw_line.js @@ -20,7 +20,6 @@ export function modeDrawLine(context, wayID, startGraph, button, affix, continui var headID = (affix === 'prefix') ? way.first() : way.last(); behavior = behaviorDrawWay(context, wayID, index, mode, startGraph) - .tail(t('modes.draw_line.tail')) .on('rejectedSelfIntersection.modeDrawLine', function() { context.ui().flash .text(t('self_intersection.error.lines'))(); diff --git a/test/spec/spec_helpers.js b/test/spec/spec_helpers.js index 4090692f5..2f6898f0a 100644 --- a/test/spec/spec_helpers.js +++ b/test/spec/spec_helpers.js @@ -29,7 +29,6 @@ mocha.setup({ timeout: 5000, // 5 sec ui: 'bdd', globals: [ - '__onresize.tail-size', '__onmousemove.zoom', '__onmouseup.zoom', '__onkeydown.select',