mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Disable Add Note '4' shortcut when notes layer is not enabled
(also return to browse mode if notes or osm layers get disabled) (closes #5190)
This commit is contained in:
@@ -8,6 +8,7 @@ import { d3keybinding as d3_keybinding } from '../lib/d3.keybinding.js';
|
||||
import { svgIcon } from '../svg';
|
||||
import { t, textDirection } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { modeBrowse } from '../modes';
|
||||
import { uiBackground } from './background';
|
||||
import { uiDisclosure } from './disclosure';
|
||||
import { uiHelp } from './help';
|
||||
@@ -75,6 +76,11 @@ export function uiMapData(context) {
|
||||
var layer = layers.layer(which);
|
||||
if (layer) {
|
||||
layer.enabled(enabled);
|
||||
|
||||
if (!enabled && (which === 'osm' || which === 'notes')) {
|
||||
context.enter(modeBrowse(context));
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ export function uiModes(context) {
|
||||
|
||||
modes.forEach(function(mode) {
|
||||
keybinding.on(mode.key, function() {
|
||||
if (mode.id === 'add-note' && !notesEditable()) return;
|
||||
if (mode.id === 'add-note' && !(notesEnabled() && notesEditable())) return;
|
||||
if (mode.id !== 'add-note' && !editable()) return;
|
||||
|
||||
if (mode.id === context.mode().id) {
|
||||
|
||||
Reference in New Issue
Block a user