Use 0 instead of the word auto for scale

pull/2993/head
Isaac Connor 2020-07-22 17:28:41 -04:00
parent 7fd038d99b
commit e746f0babe
2 changed files with 11 additions and 12 deletions

View File

@ -59,7 +59,7 @@ if ( isset( $_REQUEST['scale'] ) ) {
} else {
$scale = max(reScale(SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE), SCALE_BASE);
}
$scale = $scale ?: 'auto';
$scale = $scale ? $scale : 0;
$imageData = $Event->getImageSrc($frame, $scale, 0);
if ( !$imageData ) {
@ -92,7 +92,7 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
<?php if ( canEdit('Events') ) { ?><a href="?view=none&amp;action=delete&amp;markEid=<?php echo $Event->Id() ?>"><?php echo translate('Delete') ?></a><?php } ?>
<a href="#" data-on-click="closeWindow"><?php echo translate('Close') ?></a>
</div>
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo buildSelect('scale', $scales); ?></div>
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo htmlSelect('scale', $scales, $scale); ?></div>
<h2><?php echo translate('Frame') ?> <?php echo $Event->Id().'-'.$Frame->FrameId().' ('.$Frame->Score().')' ?></h2>
<input type="hidden" name="base_width" id="base_width" value="<?php echo $Event->Width(); ?>"/>
<input type="hidden" name="base_height" id="base_height" value="<?php echo $Event->Height(); ?>"/>
@ -100,7 +100,6 @@ xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->Frame
</div>
<div id="content">
<p id="image">
<?php if ( $imageData['hasAnalImage'] ) {
echo sprintf('<a href="?view=frame&amp;eid=%d&amp;fid=%d&scale=%d&amp;show=%s">', $Event->Id(), $Frame->FrameId(), $scale, ( $show=='anal'?'capt':'anal' ) );
} ?>

View File

@ -11,7 +11,7 @@ function changeScale() {
if ( img ) {
var baseWidth = $j('#base_width').val();
var baseHeight = $j('#base_height').val();
if ( scale == 'auto' ) {
if ( ! parseInt(scale) ) {
var newSize = scaleToFit(baseWidth, baseHeight, img, $j('#controls'));
newWidth = newSize.width;
newHeight = newSize.height;
@ -32,7 +32,7 @@ function changeScale() {
});
}
if ( scale == 'auto' ) {
if ( !scale ) {
$j(document).ready(changeScale);
}