Bläddra i källkod

Editor: Menubar rollover clean up.

Mr.doob 11 år sedan
förälder
incheckning
556be8bed0

+ 6 - 0
editor/css/dark.css

@@ -83,6 +83,7 @@ input.Number {
 }
 
 #viewport {
+	position: absolute;
 	top: 32px;
 	left: 0px;
 	right: 300px;
@@ -110,12 +111,17 @@ input.Number {
 	}
 
 		#menubar .menu .options {
+			display: none;
 			padding: 5px 0px;
 			background-color: #111;
 			width: 140px;
 			border-top: solid 1px #1D1D1D;
 		}
 
+		#menubar .menu:hover .options {
+			display: block;
+		}
+
 			#menubar .menu .options hr {
 				border-color: #444;
 			}

+ 6 - 0
editor/css/light.css

@@ -57,6 +57,7 @@ input.Number {
 }
 
 #viewport {
+	position: absolute;
 	top: 32px;
 	left: 0px;
 	right: 300px;
@@ -84,11 +85,16 @@ input.Number {
 	}
 
 		#menubar .menu .options {
+			display: none;
 			padding: 5px 0px;
 			background: #eee;
 			width: 140px;
 		}
 
+		#menubar .menu:hover .options {
+			display: block;
+		}
+
 			#menubar .menu .options hr {
 				border-color: #ddd;
 			}

+ 0 - 4
editor/js/Menubar.Add.js

@@ -2,9 +2,6 @@ Menubar.Add = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 	var title = new UI.Panel();
 	title.setTextContent( 'Add' );
@@ -16,7 +13,6 @@ Menubar.Add = function ( editor ) {
 
 	var options = new UI.Panel();
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 
 	var meshCount = 0;

+ 0 - 4
editor/js/Menubar.Edit.js

@@ -2,9 +2,6 @@ Menubar.Edit = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 	var title = new UI.Panel();
 	title.setTextContent( 'Edit' );
@@ -16,7 +13,6 @@ Menubar.Edit = function ( editor ) {
 
 	var options = new UI.Panel();
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 
 	// clone

+ 0 - 4
editor/js/Menubar.File.js

@@ -2,9 +2,6 @@ Menubar.File = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 	var title = new UI.Panel();
 	title.setTextContent( 'File' );
@@ -16,7 +13,6 @@ Menubar.File = function ( editor ) {
 
 	var options = new UI.Panel();
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 
 	// new

+ 0 - 4
editor/js/Menubar.Help.js

@@ -2,9 +2,6 @@ Menubar.Help = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 	var title = new UI.Panel();
 	title.setTextContent( 'Help' );
@@ -16,7 +13,6 @@ Menubar.Help = function ( editor ) {
 
 	var options = new UI.Panel();
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 
 	// source code

+ 0 - 4
editor/js/Menubar.View.js

@@ -2,9 +2,6 @@ Menubar.View = function ( editor ) {
 
 	var container = new UI.Panel();
 	container.setClass( 'menu' );
-	container.onMouseOver( function () { options.setDisplay( 'block' ) } );
-	container.onMouseOut( function () { options.setDisplay( 'none' ) } );
-	container.onClick( function () { options.setDisplay( 'block' ) } );
 
 	var title = new UI.Panel();
 	title.setTextContent( 'View' );
@@ -16,7 +13,6 @@ Menubar.View = function ( editor ) {
 
 	var options = new UI.Panel();
 	options.setClass( 'options' );
-	options.setDisplay( 'none' );
 	container.add( options );
 
 	// themes