Skip to content

Commit

Permalink
Make clean button always visible
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Sep 22, 2024
1 parent 6a672c4 commit da4636d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 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

0 comments on commit da4636d

Please sign in to comment.