Update the source when the base layer change.

This commit is contained in:
Antoine Vandecreme 2014-01-30 16:59:51 -05:00
parent d43b6d86b5
commit 695df873ca
2 changed files with 4 additions and 3 deletions

View File

@ -1155,8 +1155,9 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
if ( THIS[ this.hash ].sequenced ) { if ( THIS[ this.hash ].sequenced ) {
throw new Error( "Cannot reassign base level when in sequence mode." ); throw new Error( "Cannot reassign base level when in sequence mode." );
} }
// We need to re-assign the base drawer // We need to re-assign the base drawer and the source
this.drawer = level === 0 ? drawer : this.getLayerAtLevel( level ); this.drawer = level === 0 ? drawer : this.getLayerAtLevel( level );
this.source = this.drawer.source;
} }
this.drawers.splice( oldLevel, 1 ); this.drawers.splice( oldLevel, 1 );
this.drawers.splice( level, 0, drawer ); this.drawers.splice( level, 0, drawer );

View File

@ -146,13 +146,13 @@
} }
function updateOrder() { function updateOrder() {
var nbLayers = viewer.getNumberOfLayers(); var nbLayers = viewer.getLayersCount();
if ( nbLayers < 2 ) { if ( nbLayers < 2 ) {
return; return;
} }
$.each( $( "#used select option" ), function( index, value ) { $.each( $( "#used select option" ), function( index, value ) {
var layer = value.innerHTML; var layer = value.innerHTML;
viewer.setLayerLevel( layers[layer], nbLayers - index ); viewer.setLayerLevel( layers[layer], nbLayers -1 - index );
} ); } );
} }