diff --git a/index.html b/index.html index a9898a7fb..11f315d78 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@ id.ui()(document.getElementById('id-container')); - d3.select('#about-list').insert('li', '.user-list') + iD.d3.select('#about-list').insert('li', '.user-list') .attr('class', 'source-switch') .call(iD.ui.SourceSwitch(id) .keys([ diff --git a/modules/behavior/add_way.js b/modules/behavior/add_way.js index 1c3fd4c02..476a6d779 100644 --- a/modules/behavior/add_way.js +++ b/modules/behavior/add_way.js @@ -4,13 +4,13 @@ import { Browse } from '../modes/index'; import { Draw } from './draw'; export function AddWay(context) { - var event = d3.dispatch('start', 'startFromWay', 'startFromNode'), + var dispatch = d3.dispatch('start', 'startFromWay', 'startFromNode'), draw = Draw(context); var addWay = function(surface) { - draw.on('click', event.start) - .on('clickWay', event.startFromWay) - .on('clickNode', event.startFromNode) + draw.on('click', function() { dispatch.apply('start', this, arguments); }) + .on('clickWay', function() { dispatch.apply('startFromWay', this, arguments); }) + .on('clickNode', function() { dispatch.apply('startFromNode', this, arguments); }) .on('cancel', addWay.cancel) .on('finish', addWay.cancel); @@ -37,5 +37,5 @@ export function AddWay(context) { return addWay; }; - return rebind(addWay, event, 'on'); + return rebind(addWay, dispatch, 'on'); } diff --git a/modules/index.js b/modules/index.js index 046e40d95..52c6cc34f 100644 --- a/modules/index.js +++ b/modules/index.js @@ -36,8 +36,10 @@ export { TileLayer } from './renderer/tile_layer'; import * as data from '../data/index.js'; export var debug = false; +import * as d3 from 'd3'; export { + d3, data, actions, geo,