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

Editor: Prettier Shadow panel.

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