fixed BUG-14 (add/sel buttons not being disabled again when no selections)

This commit is contained in:
2021-01-08 21:35:38 +11:00
parent 797a281820
commit 890b2cdc4e
2 changed files with 21 additions and 6 deletions

1
BUGs
View File

@@ -1,5 +1,4 @@
#### BUGS (next-15)
BUG-14: Add/Rem Sel buttons don't disable again if all selections are NULL
### DB/back-end
BUG-2: series does not deal with calcd_rating...

View File

@@ -1,9 +1,14 @@
<script>
function ActivateBFLRemSelButton()
{
if( $("#book_table input:checkbox:checked").length > 0 )
{
$('#bfl-remsel-btn').removeClass('disabled')
$('#bfl-remsel-btn').attr('disabled',false)
}
else
DeactivateBFLRemSelButton()
}
function DeactivateBFLRemSelButton()
{
@@ -51,15 +56,26 @@
}
function ActivateBFLAddSelButton()
{
if( $("#addsel_table input:checkbox:checked").length > 0 )
{
$('#bfl-addsel-btn').removeClass('disabled')
$('#bfl-addsel-btn').attr('disabled',false)
}
else
DeactivateBFLAddSelButton()
}
function DeactivateBFLAddSelButton()
{
$('#bfl-addsel-btn').addClass('disabled')
$('#bfl-addsel-btn').attr('disabled',true)
}
function RemoveBFLAddSelButton()
{
DeactivateBFLAddSelButton()
$('#bfl-addsel-btn').attr('style','display:none')
}
@@ -67,7 +83,7 @@
{
var params=$("#addsel_table :input").serializeArray()
$.post( "/add_books_to_loan/" + {{loan_id}}, params, function(data) {
DeactivateBFLAddSelButton()
RemoveBFLAddSelButton()
DeactivateBFLRemSelButton()
$('#bfl-search-term').val('')
$('#bfl-new').html('')