Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ZoneMinder/zoneminder
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Sep 23, 2024
2 parents 194337c + 53df3a6 commit d513451
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
4 changes: 1 addition & 3 deletions web/skins/classic/views/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@
<i class="material-icons">add_circle</i>
<span class="text">&nbsp;<?php echo translate('AddNewMonitor') ?></span>
</button>
<button type="button" name="cloneBtn" data-on-click-this="cloneMonitor"
<?php echo $canCreateMonitors ? '' : ' disabled="disabled"' ?>
style="display:none;">
<button type="button" name="cloneBtn" data-on-click-this="cloneMonitor" disabled="disabled">
<i class="material-icons">content_copy</i>
<!--content_copy used instead of file_copy as there is a bug in material-icons -->
<span class="text">&nbsp;<?php echo translate('CloneMonitor') ?></span>
Expand Down
12 changes: 4 additions & 8 deletions web/skins/classic/views/js/console.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function setButtonStates(element) {
var form = element.form;
const form = element.form;
var checked = 0;
for ( var i=0; i < form.elements.length; i++ ) {
for ( var i=0, len = form.elements.length; i < len; i++ ) {
if (
form.elements[i].type == "checkbox" &&
form.elements[i].name == "markMids[]"
Expand All @@ -19,16 +19,12 @@ function setButtonStates(element) {
form.editBtn.disabled = false;
form.deleteBtn.disabled = false;
form.selectBtn.disabled = false;
if ( checked == 1 ) {
$j(form.cloneBtn).css('display', 'inline');
} else {
$j(form.cloneBtn).hide();
}
form.cloneBtn.disabled = false;
} else {
$j(form.cloneBtn).hide();
form.editBtn.disabled = true;
form.deleteBtn.disabled = true;
form.selectBtn.disabled = true;
form.cloneBtn.disabled = true;
}
}

Expand Down
11 changes: 8 additions & 3 deletions web/skins/classic/views/js/montage.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ function initPage() {

document.addEventListener('scrollend', on_scroll); // for non-sticky
document.getElementById('content').addEventListener('scrollend', on_scroll);
window.addEventListener('resize', on_scroll);
} // end initPage

function on_scroll() {
Expand All @@ -860,12 +861,16 @@ function isOutOfViewport(elem) {

// Check if it's out of the viewport on each side
const out = {};
out.top = (bounding.top < headerHeight) || ( bounding.top > (window.innerHeight || document.documentElement.clientHeight) );
out.topUp = (bounding.top < headerHeight);
out.topDown = ( bounding.top > (window.innerHeight || document.documentElement.clientHeight) );
out.top = (out.topUp || out.topDown);
out.left = (bounding.left < 0) || (bounding.left > (window.innerWidth || document.documentElement.clientWidth));
out.bottom = (bounding.bottom > (window.innerHeight-headerHeight || document.documentElement.clientHeight-headerHeight) ) || (bounding.bottom < 0);
out.bottomUp = (bounding.bottom < headerHeight);
out.bottomDown = (bounding.bottom > (window.innerHeight-headerHeight || document.documentElement.clientHeight-headerHeight) );
out.bottom = (out.bottomUp || out.bottomDown);
out.right = (bounding.right > (window.innerWidth || document.documentElement.clientWidth) ) || (bounding.right < 0);
out.any = out.top || out.left || out.bottom || out.right;
out.all = (out.top && out.bottom ) || (out.left && out.right);
out.all = (out.topUp && out.bottomUp ) || (out.topDown && out.bottomDown ) || (out.left && out.right);
//console.log( 'top: ' + out.top + ' left: ' + out.left + ' bottom: '+out.bottom + ' right: '+out.right);

return out;
Expand Down

0 comments on commit d513451

Please sign in to comment.