fixed bug with swapping book in series when we dont have details on book to swap with, also really disabled up/down buttons, rather than just made them look disabled

This commit is contained in:
2020-11-29 17:40:04 +11:00
parent 99f0a9fdbf
commit 8d64b95d9f
3 changed files with 40 additions and 33 deletions

View File

@@ -45,18 +45,18 @@
{% if SeriesBookNum( series.id, book.id ) == 1 %}
<script>
{% if book.parent_ref|length %}
$('#up-{{book.parent_ref[0].book_id}}').addClass("disabled")
$('#up-{{book.parent_ref[0].book_id}}').prop("disabled", true)
{% else %}
$('#up-{{book.id}}').addClass("disabled")
$('#up-{{book.id}}').prop("disabled", true)
{% endif %}
</script>
{% endif %}
{% if SeriesBookNum( series.id, book.id ) == series.num_books %}
<script>
{% if book.parent_ref|length %}
$('#down-{{book.parent_ref[0].book_id}}').addClass("disabled")
$('#down-{{book.parent_ref[0].book_id}}').prop("disabled", true)
{% else %}
$('#down-{{book.id}}').addClass("disabled")
$('#down-{{book.id}}').prop("disabled", true)
{% endif %}
</script>
{% endif %}