point, line, area mode buttons now toggle

This commit is contained in:
Ansis Brammanis
2013-03-29 19:05:50 -04:00
parent e13305b162
commit 745240c20b
+7 -1
View File
@@ -11,7 +11,13 @@ iD.ui.Modes = function(context) {
buttons.enter().append('button')
.attr('tabindex', -1)
.attr('class', function(mode) { return mode.id + ' add-button col4'; })
.on('click.mode-buttons', function(mode) { context.enter(mode); })
.on('click.mode-buttons', function(mode) {
if (mode.id === context.mode().id) {
context.enter(iD.modes.Browse(context));
} else {
context.enter(mode);
}
})
.call(bootstrap.tooltip()
.placement('bottom')
.html(true)