Browse Source

Editor: Moved SidebarAnimation to SidebarObjectAnimation.

Mr.doob 1 year ago
parent
commit
c5d243f97e
4 changed files with 13 additions and 8 deletions
  1. 5 4
      editor/js/Sidebar.Object.Animation.js
  2. 6 0
      editor/js/Sidebar.Object.js
  3. 1 3
      editor/js/Sidebar.js
  4. 1 1
      editor/sw.js

+ 5 - 4
editor/js/Sidebar.Animation.js → editor/js/Sidebar.Object.Animation.js

@@ -1,6 +1,6 @@
-import { UIPanel, UIBreak, UIButton, UIDiv, UIText, UINumber, UIRow } from './libs/ui.js';
+import { UIBreak, UIButton, UIDiv, UIText, UINumber, UIRow } from './libs/ui.js';
 
-function SidebarAnimation( editor ) {
+function SidebarObjectAnimation( editor ) {
 
 	const strings = editor.strings;
 	const signals = editor.signals;
@@ -71,7 +71,8 @@ function SidebarAnimation( editor ) {
 
 	} );
 
-	const container = new UIPanel();
+	const container = new UIDiv();
+	container.setMarginTop( '20px' );
 	container.setDisplay( 'none' );
 
 	container.add( new UIText( strings.getKey( 'sidebar/animations' ) ).setTextTransform( 'uppercase' ) );
@@ -98,4 +99,4 @@ function SidebarAnimation( editor ) {
 
 }
 
-export { SidebarAnimation };
+export { SidebarObjectAnimation };

+ 6 - 0
editor/js/Sidebar.Object.js

@@ -10,6 +10,8 @@ import { SetRotationCommand } from './commands/SetRotationCommand.js';
 import { SetScaleCommand } from './commands/SetScaleCommand.js';
 import { SetColorCommand } from './commands/SetColorCommand.js';
 
+import { SidebarObjectAnimation } from './Sidebar.Object.Animation.js';
+
 function SidebarObject( editor ) {
 
 	const strings = editor.strings;
@@ -416,6 +418,10 @@ function SidebarObject( editor ) {
 	} );
 	container.add( exportJson );
 
+	// Animations
+
+	container.add( new SidebarObjectAnimation( editor ) );
+
 	//
 
 	function update() {

+ 1 - 3
editor/js/Sidebar.js

@@ -2,7 +2,6 @@ import { UITabbedPanel, UISpan } from './libs/ui.js';
 
 import { SidebarScene } from './Sidebar.Scene.js';
 import { SidebarProperties } from './Sidebar.Properties.js';
-import { SidebarAnimation } from './Sidebar.Animation.js';
 import { SidebarProject } from './Sidebar.Project.js';
 import { SidebarSettings } from './Sidebar.Settings.js';
 
@@ -15,8 +14,7 @@ function Sidebar( editor ) {
 
 	const scene = new UISpan().add(
 		new SidebarScene( editor ),
-		new SidebarProperties( editor ),
-		new SidebarAnimation( editor )
+		new SidebarProperties( editor )
 	);
 	const project = new SidebarProject( editor );
 	const settings = new SidebarSettings( editor );

+ 1 - 1
editor/sw.js

@@ -155,6 +155,7 @@ const assets = [
 	'./js/Sidebar.Settings.Shortcuts.js',
 	'./js/Sidebar.Properties.js',
 	'./js/Sidebar.Object.js',
+	'./js/Sidebar.Object.Animation.js',
 	'./js/Sidebar.Geometry.js',
 	'./js/Sidebar.Geometry.BufferGeometry.js',
 	'./js/Sidebar.Geometry.Modifiers.js',
@@ -182,7 +183,6 @@ const assets = [
 	'./js/Sidebar.Material.MapProperty.js',
 	'./js/Sidebar.Material.NumberProperty.js',
 	'./js/Sidebar.Material.Program.js',
-	'./js/Sidebar.Animation.js',
 	'./js/Sidebar.Script.js',
 	'./js/Strings.js',
 	'./js/Toolbar.js',