Fix selecting layout after save by using value in session. When applying layout, if height is auto, set the img height to auto.
This commit is contained in:
parent
17fbafd7de
commit
1ab294e291
|
@ -210,7 +210,6 @@ function Monitor(monitorData) {
|
||||||
* @param {*} element - the event data passed by onchange callback
|
* @param {*} element - the event data passed by onchange callback
|
||||||
*/
|
*/
|
||||||
function selectLayout(element) {
|
function selectLayout(element) {
|
||||||
console.log(element);
|
|
||||||
layout = $j(element).val();
|
layout = $j(element).val();
|
||||||
|
|
||||||
if ( layout_id = parseInt(layout) ) {
|
if ( layout_id = parseInt(layout) ) {
|
||||||
|
@ -222,7 +221,7 @@ function selectLayout(element) {
|
||||||
|
|
||||||
monitor_frame = $j('#monitorFrame'+monitor.id);
|
monitor_frame = $j('#monitorFrame'+monitor.id);
|
||||||
if ( !monitor_frame ) {
|
if ( !monitor_frame ) {
|
||||||
console.log("Error finding frame for " + monitor.id);
|
console.log('Error finding frame for ' + monitor.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,6 +261,10 @@ function selectLayout(element) {
|
||||||
if ( streamImg.nodeName == 'IMG' ) {
|
if ( streamImg.nodeName == 'IMG' ) {
|
||||||
var src = streamImg.src;
|
var src = streamImg.src;
|
||||||
src = src.replace(/width=[\.\d]+/i, 'width=0' );
|
src = src.replace(/width=[\.\d]+/i, 'width=0' );
|
||||||
|
if ( $j('#height').val() == 'auto' ) {
|
||||||
|
src = src.replace(/height=[\.\d]+/i, 'height=0' );
|
||||||
|
streamImg.style.height = 'auto';
|
||||||
|
}
|
||||||
if ( src != streamImg.src ) {
|
if ( src != streamImg.src ) {
|
||||||
streamImg.src = '';
|
streamImg.src = '';
|
||||||
streamImg.src = src;
|
streamImg.src = src;
|
||||||
|
|
|
@ -69,17 +69,19 @@ foreach ( $layouts as $l ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ( $layouts as $l ) {
|
foreach ( $layouts as $l ) {
|
||||||
if ( $l->Name() != "Freeform" )
|
if ( $l->Name() != 'Freeform' )
|
||||||
$layoutsById[$l->Id()] = $l;
|
$layoutsById[$l->Id()] = $l;
|
||||||
}
|
}
|
||||||
|
|
||||||
session_start();
|
zm_session_start();
|
||||||
|
|
||||||
$layout_id = '';
|
$layout_id = '';
|
||||||
if ( isset($_COOKIE['zmMontageLayout']) ) {
|
if ( isset($_COOKIE['zmMontageLayout']) ) {
|
||||||
$layout_id = $_SESSION['zmMontageLayout'] = $_COOKIE['zmMontageLayout'];
|
$layout_id = $_SESSION['zmMontageLayout'] = $_COOKIE['zmMontageLayout'];
|
||||||
#} elseif ( isset($_SESSION['zmMontageLayout']) ) {
|
ZM\Logger::Debug("Using layout $layout_id");
|
||||||
#$layout_id = $_SESSION['zmMontageLayout'];
|
} elseif ( isset($_SESSION['zmMontageLayout']) ) {
|
||||||
|
$layout_id = $_SESSION['zmMontageLayout'];
|
||||||
|
ZM\Logger::Debug("Using layout $layout_id from session");
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
|
@ -88,6 +90,8 @@ $Positions = '';
|
||||||
if ( $layout_id and is_numeric($layout_id) and isset($layoutsById[$layout_id]) ) {
|
if ( $layout_id and is_numeric($layout_id) and isset($layoutsById[$layout_id]) ) {
|
||||||
$Layout = $layoutsById[$layout_id];
|
$Layout = $layoutsById[$layout_id];
|
||||||
$Positions = json_decode($Layout->Positions(), true);
|
$Positions = json_decode($Layout->Positions(), true);
|
||||||
|
} else {
|
||||||
|
ZM\Logger::Debug("Layout not found");
|
||||||
}
|
}
|
||||||
if ( $Layout and ( $Layout->Name() != 'Freeform' ) ) {
|
if ( $Layout and ( $Layout->Name() != 'Freeform' ) ) {
|
||||||
// Use layout instead of other options
|
// Use layout instead of other options
|
||||||
|
|
Loading…
Reference in New Issue