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

Editor: Prettier Shadow panel.

上级 14b7e324
...@@ -247,21 +247,27 @@ Sidebar.Object3D = function ( editor ) { ...@@ -247,21 +247,27 @@ Sidebar.Object3D = function ( editor ) {
// shadow // shadow
var objectCastShadowRow = new UI.Panel(); var objectShadowRow = new UI.Panel();
objectShadowRow.add( new UI.Text( 'Shadow' ).setWidth( '90px' ) );
var objectCastShadowSpan = new UI.Span();
var objectCastShadow = new UI.Checkbox().onChange( update ); var objectCastShadow = new UI.Checkbox().onChange( update );
objectCastShadowRow.add( new UI.Text( 'Cast Shadow' ).setWidth( '90px' ) ); objectCastShadowSpan.add( objectCastShadow );
objectCastShadowRow.add( objectCastShadow ); objectCastShadowSpan.add( new UI.Text( 'cast' ).setMarginRight( '10px' ) );
container.add( objectCastShadowRow ); objectShadowRow.add( objectCastShadowSpan );
var objectReceiveShadowRow = new UI.Panel(); var objectReceiveShadowSpan = new UI.Span();
var objectReceiveShadow = new UI.Checkbox().onChange( update ); var objectReceiveShadow = new UI.Checkbox().onChange( update );
objectReceiveShadowRow.add( new UI.Text( 'Receive Shad' ).setWidth( '90px' ) ); objectReceiveShadowSpan.add( objectReceiveShadow );
objectReceiveShadowRow.add( objectReceiveShadow ); objectReceiveShadowSpan.add( new UI.Text( 'receive' ) );
objectShadowRow.add( objectReceiveShadowSpan );
container.add( objectReceiveShadowRow ); container.add( objectShadowRow );
// visible // visible
...@@ -493,8 +499,8 @@ Sidebar.Object3D = function ( editor ) { ...@@ -493,8 +499,8 @@ Sidebar.Object3D = function ( editor ) {
'angle' : objectAngleRow, 'angle' : objectAngleRow,
'exponent' : objectExponentRow, 'exponent' : objectExponentRow,
'decay' : objectDecayRow, 'decay' : objectDecayRow,
'castShadow' : objectCastShadowRow, 'castShadow' : objectShadowRow,
'receiveShadow' : objectReceiveShadowRow 'receiveShadow' : objectReceiveShadowSpan
}; };
for ( var property in properties ) { for ( var property in properties ) {
......
...@@ -90,6 +90,8 @@ UI.Element.prototype = { ...@@ -90,6 +90,8 @@ UI.Element.prototype = {
} }
return this;
}, },
setDisabled: function ( value ) { setDisabled: function ( value ) {
...@@ -123,6 +125,7 @@ properties.forEach( function ( property ) { ...@@ -123,6 +125,7 @@ properties.forEach( function ( property ) {
UI.Element.prototype[ method ] = function () { UI.Element.prototype[ method ] = function () {
this.setStyle( property, arguments ); this.setStyle( property, arguments );
return this; return this;
}; };
...@@ -147,6 +150,21 @@ events.forEach( function ( event ) { ...@@ -147,6 +150,21 @@ events.forEach( function ( event ) {
} ); } );
// Span
UI.Span = function () {
UI.Element.call( this );
this.dom = document.createElement( 'span' );
return this;
};
UI.Span.prototype = Object.create( UI.Element.prototype );
UI.Span.prototype.constructor = UI.Span;
// Panel // Panel
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册