mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-16 18:52:57 +00:00
Put success close click handler on button, not span (closes #2717)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
iD.ui.Commit = function(context) {
|
||||
var event = d3.dispatch('cancel', 'save');
|
||||
var dispatch = d3.dispatch('cancel', 'save');
|
||||
|
||||
function commit(selection) {
|
||||
var changes = context.history().changes(),
|
||||
@@ -22,7 +22,7 @@ iD.ui.Commit = function(context) {
|
||||
|
||||
header.append('button')
|
||||
.attr('class', 'fr')
|
||||
.on('click', event.cancel)
|
||||
.on('click.commit', function() { dispatch.cancel(); })
|
||||
.append('span')
|
||||
.attr('class', 'icon close');
|
||||
|
||||
@@ -119,7 +119,7 @@ iD.ui.Commit = function(context) {
|
||||
var saveButton = saveSection.append('button')
|
||||
.attr('class', 'action col6 button')
|
||||
.on('click.save', function() {
|
||||
event.save({
|
||||
dispatch.save({
|
||||
comment: commentField.node().value
|
||||
});
|
||||
});
|
||||
@@ -204,5 +204,5 @@ iD.ui.Commit = function(context) {
|
||||
}
|
||||
}
|
||||
|
||||
return d3.rebind(commit, event, 'on');
|
||||
return d3.rebind(commit, dispatch, 'on');
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.ui.Success = function(context) {
|
||||
var event = d3.dispatch('cancel'),
|
||||
var dispatch = d3.dispatch('cancel'),
|
||||
changeset;
|
||||
|
||||
function success(selection) {
|
||||
@@ -11,9 +11,9 @@ iD.ui.Success = function(context) {
|
||||
|
||||
header.append('button')
|
||||
.attr('class', 'fr')
|
||||
.on('click', function() { dispatch.cancel(); })
|
||||
.append('span')
|
||||
.attr('class', 'icon close')
|
||||
.on('click', function() { event.cancel(success); });
|
||||
.attr('class', 'icon close');
|
||||
|
||||
header.append('h3')
|
||||
.text(t('success.just_edited'));
|
||||
@@ -55,5 +55,5 @@ iD.ui.Success = function(context) {
|
||||
return success;
|
||||
};
|
||||
|
||||
return d3.rebind(success, event, 'on');
|
||||
return d3.rebind(success, dispatch, 'on');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user