mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Namespace all events
This commit is contained in:
@@ -4,6 +4,7 @@ iD.modes.DrawRoad = function(wayId, direction) {
|
||||
};
|
||||
|
||||
mode.enter = function() {
|
||||
|
||||
var map = mode.map,
|
||||
history = mode.history,
|
||||
controller = mode.controller,
|
||||
|
||||
@@ -53,7 +53,7 @@ iD.modes.Select = function (entity) {
|
||||
mode.enter = function () {
|
||||
iD.modes._dragFeatures(mode);
|
||||
|
||||
target = mode.map.surface.selectAll("*")
|
||||
target = mode.map.surface.selectAll('*')
|
||||
.filter(function (d) { return d === entity; });
|
||||
|
||||
d3.select('.inspector-wrap')
|
||||
@@ -88,7 +88,7 @@ iD.modes.Select = function (entity) {
|
||||
target.call(dragWay);
|
||||
}
|
||||
|
||||
mode.map.surface.on("click.browse", function () {
|
||||
mode.map.surface.on('click.browse', function () {
|
||||
var datum = d3.select(d3.event.target).datum();
|
||||
if (datum instanceof iD.Entity) {
|
||||
mode.controller.enter(iD.modes.Select(datum));
|
||||
@@ -116,7 +116,7 @@ iD.modes.Select = function (entity) {
|
||||
.on('touchstart.drag', null);
|
||||
}
|
||||
|
||||
mode.map.surface.on("click.browse", null);
|
||||
mode.map.surface.on('click.browse', null);
|
||||
mode.map.keybinding().on('⌫.browse', null);
|
||||
|
||||
mode.map.selection(null);
|
||||
|
||||
@@ -33,8 +33,8 @@ iD.Map = function() {
|
||||
.call(zoom);
|
||||
|
||||
surface = supersurface.append('svg')
|
||||
.on('mouseup', resetTransform)
|
||||
.on('touchend', resetTransform);
|
||||
.on('mouseup.reset-transform', resetTransform)
|
||||
.on('touchend.reset-transform', resetTransform);
|
||||
|
||||
defs = surface.append('defs');
|
||||
defs.append('clipPath')
|
||||
|
||||
@@ -40,14 +40,14 @@ iD.commit = function() {
|
||||
|
||||
body.append('button').text('Save')
|
||||
.attr('class', 'save')
|
||||
.on('click', function() {
|
||||
.on('click.save', function() {
|
||||
event.save({
|
||||
comment: d3.select('textarea.changeset-comment').node().value
|
||||
});
|
||||
});
|
||||
body.append('button').text('Cancel')
|
||||
.attr('class', 'cancel')
|
||||
.on('click', function() {
|
||||
.on('click.cancel', function() {
|
||||
event.cancel();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ iD.confirm = function(message) {
|
||||
modal.select('.content')
|
||||
.append('button')
|
||||
.text('OK')
|
||||
.on('click', function() {
|
||||
.on('click.confirm', function() {
|
||||
modal.remove();
|
||||
});
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ iD.layerswitcher = function(map) {
|
||||
.attr('data-original-title', function(d) {
|
||||
return d.label + " opacity";
|
||||
})
|
||||
.on('click', function(d) {
|
||||
.on('click.set-opacity', function(d) {
|
||||
d3.select('#tile-g')
|
||||
.transition()
|
||||
.style('opacity', d.level)
|
||||
@@ -116,7 +116,7 @@ iD.layerswitcher = function(map) {
|
||||
return d.name;
|
||||
})
|
||||
.call(bootstrap.tooltip().placement('right'))
|
||||
.on('click', function(d) {
|
||||
.on('click.set-source', function(d) {
|
||||
d3.event.preventDefault();
|
||||
map.background.source(d.source);
|
||||
map.redraw();
|
||||
|
||||
@@ -7,7 +7,7 @@ iD.modal = function() {
|
||||
var shaded = d3.select(document.body)
|
||||
.append('div').attr('class', 'shaded')
|
||||
.style('opacity', 0)
|
||||
.on('click', function() {
|
||||
.on('click.remove-modal', function() {
|
||||
if (d3.event.target == this) this.remove();
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ iD.userpanel = function(connection) {
|
||||
.attr('class', 'logout')
|
||||
.attr('href', '#')
|
||||
.text('logout')
|
||||
.on('click', function() {
|
||||
.on('click.logout', function() {
|
||||
d3.event.preventDefault();
|
||||
event.logout();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user