Fix source toggle, fix way drawing

This commit is contained in:
Tom MacWright
2016-09-04 17:33:42 -04:00
parent 9834f66f66
commit 760c515c8a
3 changed files with 8 additions and 6 deletions

View File

@@ -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([

View File

@@ -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');
}

View File

@@ -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,