Ver Fonte

Simplified UI.MenubarHelper.

Mr.doob há 11 anos atrás
pai
commit
afd947f28b
1 ficheiros alterados com 18 adições e 23 exclusões
  1. 18 23
      editor/js/libs/ui.js

+ 18 - 23
editor/js/libs/ui.js

@@ -947,14 +947,12 @@ UI.Button.prototype.setLabel = function ( value ) {
 };
 };
 
 
 
 
-UI.MenubarHelper = (function() {
+UI.MenubarHelper = {
 
 
-	function createMenuContainer( name, optionsPanel ) {
-		var container,
-			title;
+	createMenuContainer: function ( name, optionsPanel ) {
 
 
-		container		= new UI.Panel();
-		title			= new UI.Panel();
+		var container = new UI.Panel();
+		var title = new UI.Panel();
 
 
 		title.setTextContent( name );
 		title.setTextContent( name );
 		title.setMargin( '0px' );
 		title.setMargin( '0px' );
@@ -965,23 +963,23 @@ UI.MenubarHelper = (function() {
 		container.add( optionsPanel );
 		container.add( optionsPanel );
 
 
 		return container;
 		return container;
-	}
+
+	},
 	
 	
-	function createOption(name, callbackHandler) {
-		var option;
+	createOption: function ( name, callbackHandler ) {
 
 
-		option = new UI.Panel();
+		var option = new UI.Panel();
 		option.setClass( 'option' );
 		option.setClass( 'option' );
 		option.setTextContent( name );
 		option.setTextContent( name );
 		option.onClick( callbackHandler );
 		option.onClick( callbackHandler );
 
 
 		return option;
 		return option;
-	}
 
 
-	function createOptionsPanel(menuConfig) {
-		var options;
+	},
+
+	createOptionsPanel: function ( menuConfig ) {
 
 
-		options = new UI.Panel();
+		var options = new UI.Panel();
 		options.setClass( 'options' );
 		options.setClass( 'options' );
 
 
 		menuConfig.forEach(function(option) {
 		menuConfig.forEach(function(option) {
@@ -989,16 +987,13 @@ UI.MenubarHelper = (function() {
 		});
 		});
 
 
 		return options;
 		return options;
-	}
 
 
-	function createDivider() {
+	},
+
+	createDivider: function () {
+
 		return new UI.HorizontalRule();
 		return new UI.HorizontalRule();
+
 	}
 	}
 
 
-	return {
-		createMenuContainer:createMenuContainer,
-		createOption:createOption,
-		createOptionsPanel:createOptionsPanel,
-		createDivider:createDivider
-	};
-})();
+};