diff --git a/editor/js/Sidebar.Object3D.js b/editor/js/Sidebar.Object3D.js index 1af80ee0179e02e8676d8c3dcc66e27a9922d591..7727a1ca4f5f8a2cd7a8708def7c78558df45482 100644 --- a/editor/js/Sidebar.Object3D.js +++ b/editor/js/Sidebar.Object3D.js @@ -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 ) { diff --git a/editor/js/libs/ui.js b/editor/js/libs/ui.js index 686058d6298bb3551b8e293486becac37641952a..5ae94145e850a91f6121b4dc1e3a3359ad9c9f95 100644 --- a/editor/js/libs/ui.js +++ b/editor/js/libs/ui.js @@ -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