Bläddra i källkod

Added shortcut ('f') for focusing on selection

Tyler Lindberg 7 år sedan
förälder
incheckning
d70df5f8f2
2 ändrade filer med 13 tillägg och 2 borttagningar
  1. 2 1
      editor/js/Config.js
  2. 11 1
      editor/js/Sidebar.Settings.Shortcuts.js

+ 2 - 1
editor/js/Config.js

@@ -24,7 +24,8 @@ var Config = function ( name ) {
 		'settings/shortcuts/translate': 'w',
 		'settings/shortcuts/translate': 'w',
 		'settings/shortcuts/rotate': 'e',
 		'settings/shortcuts/rotate': 'e',
 		'settings/shortcuts/scale': 'r',
 		'settings/shortcuts/scale': 'r',
-		'settings/shortcuts/undo': 'z'
+		'settings/shortcuts/undo': 'z',
+		'settings/shortcuts/focus': 'f'
 	};
 	};
 
 
 	if ( window.localStorage[ name ] === undefined ) {
 	if ( window.localStorage[ name ] === undefined ) {

+ 11 - 1
editor/js/Sidebar.Settings.Shortcuts.js

@@ -18,7 +18,7 @@ Sidebar.Settings.Shortcuts = function ( editor ) {
 	var container = new UI.Div();
 	var container = new UI.Div();
 	container.add( new UI.Break() );
 	container.add( new UI.Break() );
 
 
-	var shortcuts = [ 'translate', 'rotate', 'scale', 'undo' ];
+	var shortcuts = [ 'translate', 'rotate', 'scale', 'undo', 'focus' ];
 
 
 	for ( var i = 0; i < shortcuts.length; i ++ ) {
 	for ( var i = 0; i < shortcuts.length; i ++ ) {
 
 
@@ -145,6 +145,16 @@ Sidebar.Settings.Shortcuts = function ( editor ) {
 
 
 				break;
 				break;
 
 
+			case config.getKey( 'settings/shortcuts/focus' ):
+
+				if ( editor.selected !== null ) {
+
+					editor.focusById( editor.selected.id );
+
+				}
+
+				break;
+
 		}
 		}
 
 
 	}, false );
 	}, false );