Explicitly set the danger class on each line because they can get out of sync when using the All toggle
This commit is contained in:
parent
babae4629a
commit
cfe53c0ffe
|
@ -2,20 +2,21 @@
|
||||||
function setButtonStates( element ) {
|
function setButtonStates( element ) {
|
||||||
var form = element.form;
|
var form = element.form;
|
||||||
var checked = 0;
|
var checked = 0;
|
||||||
// We want to know if 1 or more monitors are checked
|
|
||||||
for ( var i=0; i < form.elements.length; i++ ) {
|
for ( var i=0; i < form.elements.length; i++ ) {
|
||||||
if (
|
if (
|
||||||
form.elements[i].type=="checkbox"
|
form.elements[i].type=="checkbox"
|
||||||
&&
|
&&
|
||||||
form.elements[i].name=="markMids[]"
|
form.elements[i].name=="markMids[]"
|
||||||
&&
|
|
||||||
form.elements[i].checked
|
|
||||||
) {
|
) {
|
||||||
if ( checked++ > 1 )
|
var tr = $j(form.elements[i]).closest("tr");
|
||||||
break;
|
if ( form.elements[i].checked ) {
|
||||||
|
checked ++;
|
||||||
|
tr.addClass("danger");
|
||||||
|
} else {
|
||||||
|
tr.removeClass("danger");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(element).closest("tr").toggleClass("danger");
|
|
||||||
if ( checked ) {
|
if ( checked ) {
|
||||||
form.editBtn.disabled = false;
|
form.editBtn.disabled = false;
|
||||||
form.deleteBtn.disabled = false;
|
form.deleteBtn.disabled = false;
|
||||||
|
@ -87,8 +88,6 @@ function reloadWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function initPage() {
|
function initPage() {
|
||||||
jsTranslatedAddText = translatedAddText;
|
|
||||||
jsTranslatedCloneText = translatedCloneText;
|
|
||||||
reloadWindow.periodical( consoleRefreshTimeout );
|
reloadWindow.periodical( consoleRefreshTimeout );
|
||||||
if ( showVersionPopup )
|
if ( showVersionPopup )
|
||||||
createPopup( '?view=version', 'zmVersion', 'version' );
|
createPopup( '?view=version', 'zmVersion', 'version' );
|
||||||
|
|
Loading…
Reference in New Issue