mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
Pacify eslint, get build and tests running again
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { rebind } from '../util/rebind';
|
||||
import * as d3 from 'd3';
|
||||
import { rebind } from '../util/rebind';
|
||||
import { Browse } from '../modes/index';
|
||||
import { Draw } from './draw';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import { cmd } from '../ui/index';
|
||||
|
||||
export function Copy(context) {
|
||||
var keybinding = d3keybinding('copy');
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { rebind } from '../util/rebind';
|
||||
import * as d3 from 'd3';
|
||||
import { rebind } from '../util/rebind';
|
||||
import { prefixCSSProperty, prefixDOMProperty } from '../util/index';
|
||||
|
||||
/*
|
||||
`iD.behavior.drag` is like `d3.behavior.drag`, with the following differences:
|
||||
|
||||
@@ -62,7 +63,7 @@ export function drag() {
|
||||
|
||||
function mousedown() {
|
||||
target = this;
|
||||
event_ = event.call("of", target, arguments);
|
||||
event_ = event.call('of', target, arguments);
|
||||
var eventTarget = d3.event.target,
|
||||
touchId = d3.event.touches ? d3.event.changedTouches[0].identifier : null,
|
||||
offset,
|
||||
@@ -191,7 +192,7 @@ export function drag() {
|
||||
drag.target = function() {
|
||||
if (!arguments.length) return target;
|
||||
target = arguments[0];
|
||||
event_ = event.call("of", target, Array.prototype.slice.call(arguments, 1));
|
||||
event_ = event.call('of', target, Array.prototype.slice.call(arguments, 1));
|
||||
return drag;
|
||||
};
|
||||
|
||||
|
||||
+11
-11
@@ -1,14 +1,14 @@
|
||||
import * as d3 from 'd3';
|
||||
import { rebind } from '../util/rebind';
|
||||
import { getDimensions } from '../util/dimensions';
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import * as d3 from 'd3';
|
||||
import { chooseEdge, euclideanDistance } from '../geo/index';
|
||||
import { Edit } from './edit';
|
||||
import { Hover } from './hover';
|
||||
import { Tail } from './tail';
|
||||
|
||||
export function Draw(context) {
|
||||
var event = d3.dispatch('move', 'click', 'clickWay',
|
||||
var dispatch = d3.dispatch('move', 'click', 'clickWay',
|
||||
'clickNode', 'undo', 'cancel', 'finish'),
|
||||
keybinding = d3keybinding('draw'),
|
||||
hover = Hover(context)
|
||||
@@ -76,7 +76,7 @@ export function Draw(context) {
|
||||
|
||||
function mousemove() {
|
||||
lastMouse = d3.event;
|
||||
event.call("move", datum());
|
||||
dispatch.call('move', datum());
|
||||
}
|
||||
|
||||
function mouseenter() {
|
||||
@@ -99,16 +99,16 @@ export function Draw(context) {
|
||||
if (trySnap) {
|
||||
var choice = chooseEdge(context.childNodes(d), context.mouse(), context.projection),
|
||||
edge = [d.nodes[choice.index - 1], d.nodes[choice.index]];
|
||||
event.call("clickWay", choice.loc, edge);
|
||||
dispatch.call('clickWay', choice.loc, edge);
|
||||
} else {
|
||||
event.call("click", context.map().mouseCoordinates());
|
||||
dispatch.call('click', context.map().mouseCoordinates());
|
||||
}
|
||||
|
||||
} else if (d.type === 'node') {
|
||||
event.call("clickNode", d);
|
||||
dispatch.call('clickNode', d);
|
||||
|
||||
} else {
|
||||
event.call("click", context.map().mouseCoordinates());
|
||||
dispatch.call('click', context.map().mouseCoordinates());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,17 +138,17 @@ export function Draw(context) {
|
||||
|
||||
function backspace() {
|
||||
d3.event.preventDefault();
|
||||
event.call("undo");
|
||||
dispatch.call('undo');
|
||||
}
|
||||
|
||||
function del() {
|
||||
d3.event.preventDefault();
|
||||
event.call("cancel");
|
||||
dispatch.call('cancel');
|
||||
}
|
||||
|
||||
function ret() {
|
||||
d3.event.preventDefault();
|
||||
event.call("finish");
|
||||
dispatch.call('finish');
|
||||
}
|
||||
|
||||
function draw(selection) {
|
||||
@@ -208,7 +208,7 @@ export function Draw(context) {
|
||||
return draw;
|
||||
};
|
||||
|
||||
return rebind(draw, event, 'on');
|
||||
return rebind(draw, dispatch, 'on');
|
||||
}
|
||||
|
||||
Draw.usedTails = {};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import { t } from '../util/locale';
|
||||
import { getDimensions } from '../util/dimensions';
|
||||
import _ from 'lodash';
|
||||
import { AddEntity, AddMidpoint, AddVertex, MoveNode } from '../actions/index';
|
||||
import { Browse, Select } from '../modes/index';
|
||||
import { Node, Way } from '../core/index';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import { qsString, stringQs } from '../util/index';
|
||||
|
||||
export function Hash(context) {
|
||||
var s0 = null, // cached location.hash
|
||||
lat = 90 - 1e-8; // allowable latitude range
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import * as d3 from 'd3';
|
||||
import { rebind } from '../util/rebind';
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import * as d3 from 'd3';
|
||||
import { Entity } from '../core/index';
|
||||
|
||||
/*
|
||||
The hover behavior adds the `.hover` class on mouseover to all elements to which
|
||||
the identical datum is bound, and removes it on mouseout.
|
||||
@@ -19,7 +20,7 @@ export function Hover() {
|
||||
|
||||
function keydown() {
|
||||
if (altDisables && d3.event.keyCode === d3keybinding.modifierCodes.alt) {
|
||||
dispatch.call("hover", this, null);
|
||||
dispatch.call('hover', this, null);
|
||||
selection.selectAll('.hover')
|
||||
.classed('hover-suppressed', true)
|
||||
.classed('hover', false);
|
||||
@@ -28,7 +29,7 @@ export function Hover() {
|
||||
|
||||
function keyup() {
|
||||
if (altDisables && d3.event.keyCode === d3keybinding.modifierCodes.alt) {
|
||||
dispatch.call("hover", this, target ? target.id : null);
|
||||
dispatch.call('hover', this, target ? target.id : null);
|
||||
selection.selectAll('.hover-suppressed')
|
||||
.classed('hover-suppressed', false)
|
||||
.classed('hover', true);
|
||||
@@ -62,9 +63,9 @@ export function Hover() {
|
||||
selection.selectAll(selector)
|
||||
.classed(suppressed ? 'hover-suppressed' : 'hover', true);
|
||||
|
||||
dispatch.call("hover", this, target.id);
|
||||
dispatch.call('hover', this, target.id);
|
||||
} else {
|
||||
dispatch.call("hover", this, null);
|
||||
dispatch.call('hover', this, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
|
||||
import { ChangeTags, CopyEntities, Move as MoveAction} from '../actions/index';
|
||||
import { Extent, pointInPolygon } from '../geo/index';
|
||||
import { Move as MoveMode } from '../modes/index';
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
import { Browse, Select as SelectMode } from '../modes/index';
|
||||
import { Entity } from '../core/index';
|
||||
|
||||
export function Select(context) {
|
||||
function keydown() {
|
||||
if (d3.event && d3.event.shiftKey) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as d3 from 'd3';
|
||||
import { setTransform } from '../util/index';
|
||||
import { getDimensions } from '../util/dimensions';
|
||||
|
||||
export function Tail() {
|
||||
var text,
|
||||
container,
|
||||
|
||||
Reference in New Issue
Block a user