提交 afd947f2 编写于 作者: M Mr.doob

Simplified UI.MenubarHelper.

上级 6f6c2cc8
...@@ -947,14 +947,12 @@ UI.Button.prototype.setLabel = function ( value ) { ...@@ -947,14 +947,12 @@ UI.Button.prototype.setLabel = function ( value ) {
}; };
UI.MenubarHelper = (function() { UI.MenubarHelper = {
function createMenuContainer( name, optionsPanel ) { createMenuContainer: function ( name, optionsPanel ) {
var container,
title;
container = new UI.Panel(); var container = new UI.Panel();
title = 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() { ...@@ -965,23 +963,23 @@ UI.MenubarHelper = (function() {
container.add( optionsPanel ); container.add( optionsPanel );
return container; return container;
}
},
function createOption(name, callbackHandler) { createOption: function ( name, callbackHandler ) {
var option;
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() { ...@@ -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, \ No newline at end of file
createOption:createOption,
createOptionsPanel:createOptionsPanel,
createDivider:createDivider
};
})();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册