Переглянути джерело

Editor: Moved UI.MenubarHelper to ui.editor.

Mr.doob 11 роки тому
батько
коміт
bdf26379b7
3 змінених файлів з 51 додано та 52 видалено
  1. 1 0
      editor/index.html
  2. 50 0
      editor/js/libs/ui.editor.js
  3. 0 52
      editor/js/libs/ui.js

+ 1 - 0
editor/index.html

@@ -43,6 +43,7 @@
 
 		<script src="js/libs/signals.min.js"></script>
 		<script src="js/libs/ui.js"></script>
+		<script src="js/libs/ui.editor.js"></script>
 		<script src="js/libs/ui.three.js"></script>
 
 		<script src="js/Storage.js"></script>

+ 50 - 0
editor/js/libs/ui.editor.js

@@ -0,0 +1,50 @@
+UI.MenubarHelper = {
+
+	createMenuContainer: function ( name, optionsPanel ) {
+
+		var container = new UI.Panel();
+		var title = new UI.Panel();
+
+		title.setTextContent( name );
+		title.setMargin( '0px' );
+		title.setPadding( '8px' );
+
+		container.setClass( 'menu' );
+		container.add( title );
+		container.add( optionsPanel );
+
+		return container;
+
+	},
+	
+	createOption: function ( name, callbackHandler ) {
+
+		var option = new UI.Panel();
+		option.setClass( 'option' );
+		option.setTextContent( name );
+		option.onClick( callbackHandler );
+
+		return option;
+
+	},
+
+	createOptionsPanel: function ( menuConfig ) {
+
+		var options = new UI.Panel();
+		options.setClass( 'options' );
+
+		menuConfig.forEach(function(option) {
+			options.add(option);
+		});
+
+		return options;
+
+	},
+
+	createDivider: function () {
+
+		return new UI.HorizontalRule();
+
+	}
+
+};

+ 0 - 52
editor/js/libs/ui.js

@@ -944,56 +944,4 @@ UI.Button.prototype.setLabel = function ( value ) {
 
 	return this;
 
-};
-
-
-UI.MenubarHelper = {
-
-	createMenuContainer: function ( name, optionsPanel ) {
-
-		var container = new UI.Panel();
-		var title = new UI.Panel();
-
-		title.setTextContent( name );
-		title.setMargin( '0px' );
-		title.setPadding( '8px' );
-
-		container.setClass( 'menu' );
-		container.add( title );
-		container.add( optionsPanel );
-
-		return container;
-
-	},
-	
-	createOption: function ( name, callbackHandler ) {
-
-		var option = new UI.Panel();
-		option.setClass( 'option' );
-		option.setTextContent( name );
-		option.onClick( callbackHandler );
-
-		return option;
-
-	},
-
-	createOptionsPanel: function ( menuConfig ) {
-
-		var options = new UI.Panel();
-		options.setClass( 'options' );
-
-		menuConfig.forEach(function(option) {
-			options.add(option);
-		});
-
-		return options;
-
-	},
-
-	createDivider: function () {
-
-		return new UI.HorizontalRule();
-
-	}
-
 };