mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
In save mode, escape should cancel and return to browse mode
(closes #4230)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as d3 from 'd3';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { d3keybinding } from '../lib/d3.keybinding.js';
|
||||
import { t } from '../util/locale';
|
||||
import { JXON } from '../util/jxon';
|
||||
|
||||
@@ -34,6 +35,8 @@ export function modeSave(context) {
|
||||
id: 'save'
|
||||
};
|
||||
|
||||
var keybinding = d3keybinding('select');
|
||||
|
||||
var commit = uiCommit(context)
|
||||
.on('cancel', cancel)
|
||||
.on('save', save);
|
||||
@@ -360,6 +363,12 @@ export function modeSave(context) {
|
||||
context.ui().sidebar.show(commit);
|
||||
}
|
||||
|
||||
keybinding
|
||||
.on('⎋', cancel, true);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
context.container().selectAll('#content')
|
||||
.attr('class', 'inactive');
|
||||
|
||||
@@ -381,6 +390,8 @@ export function modeSave(context) {
|
||||
|
||||
|
||||
mode.exit = function() {
|
||||
keybinding.off();
|
||||
|
||||
context.container().selectAll('#content')
|
||||
.attr('class', 'active');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user