Fix scales after applying layout
This commit is contained in:
parent
ccaea26928
commit
dc15663030
|
@ -259,15 +259,27 @@ function selectLayout(element) {
|
|||
Cookie.write( 'zmMontageScale', '', {duration: 10*365} );
|
||||
$('scale').set('value', '');
|
||||
$('width').set('value', '0');
|
||||
} else {
|
||||
// Is freeform, we don't touch the width/height/scale settings, but we may need to update sizing and scales
|
||||
}
|
||||
var width = parseInt($('width').get('value'));
|
||||
var height = parseInt($('height').get('value'));
|
||||
var scale = $('scale').get('value');
|
||||
if ( scale ) {
|
||||
} else if ( width ) {
|
||||
scale = parseInt(100*width/monitor.width);
|
||||
} else if ( height ) {
|
||||
scale = parseInt(100*height/monitor.height);
|
||||
}
|
||||
|
||||
for ( var i = 0, length = monitors.length; i < length; i++ ) {
|
||||
var monitor = monitors[i];
|
||||
var streamImg = $('liveStream'+monitor.id);
|
||||
if ( streamImg ) {
|
||||
if ( streamImg.nodeName == 'IMG' ) {
|
||||
var src = streamImg.src;
|
||||
src = src.replace(/width=[\.\d]+/i, 'width=0' );
|
||||
if ( $j('#height').val() == '0' ) {
|
||||
src = src.replace(/height=[\.\d]+/i, 'height=0' );
|
||||
src = src.replace(/scale=\d*/i, 'scale='+scale);
|
||||
if ( height == '0' ) {
|
||||
streamImg.style.height = 'auto';
|
||||
}
|
||||
if ( src != streamImg.src ) {
|
||||
|
@ -280,7 +292,6 @@ function selectLayout(element) {
|
|||
streamImg.style.width = '100%';
|
||||
}
|
||||
} // end foreach monitor
|
||||
}
|
||||
} // end function selectLayout(element)
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue