mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 08:39:56 +02:00
Move plus/minus key list to utilKeybinding property
This commit is contained in:
+3
-2
@@ -7,6 +7,7 @@ import { t, localizer } from '../core/localizer';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { uiCmd } from './cmd';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { utilKeybinding } from '../util/keybinding';
|
||||
|
||||
|
||||
export function uiZoom(context) {
|
||||
@@ -95,12 +96,12 @@ export function uiZoom(context) {
|
||||
.call(svgIcon('#' + d.icon, 'light'));
|
||||
});
|
||||
|
||||
['plus', 'ffplus', '=', 'ffequals'].forEach(function(key) {
|
||||
utilKeybinding.plusKeys.forEach(function(key) {
|
||||
context.keybinding().on([key], zoomIn);
|
||||
context.keybinding().on([uiCmd('⌥' + key)], zoomInFurther);
|
||||
});
|
||||
|
||||
['_', '-', 'ffminus', 'dash'].forEach(function(key) {
|
||||
utilKeybinding.minusKeys.forEach(function(key) {
|
||||
context.keybinding().on([key], zoomOut);
|
||||
context.keybinding().on([uiCmd('⌥' + key)], zoomOutFurther);
|
||||
});
|
||||
|
||||
@@ -214,6 +214,9 @@ utilKeybinding.modifierProperties = {
|
||||
91: 'metaKey'
|
||||
};
|
||||
|
||||
utilKeybinding.plusKeys = ['plus', 'ffplus', '=', 'ffequals'];
|
||||
utilKeybinding.minusKeys = ['_', '-', 'ffminus', 'dash'];
|
||||
|
||||
utilKeybinding.keys = {
|
||||
// Backspace key, on Mac: ⌫ (Backspace)
|
||||
'⌫': 'Backspace', backspace: 'Backspace',
|
||||
|
||||
Reference in New Issue
Block a user