Update scroll to signature area

This commit is contained in:
Aaron Lee 2021-10-07 22:03:30 +08:00
parent f064fac7ac
commit 8eb6588b75
2 changed files with 5 additions and 2 deletions

View file

@ -114,7 +114,8 @@
↑ Confirm 確認 (Period {{i}}) ↑</button> ↑ Confirm 確認 (Period {{i}}) ↑</button>
{% endif %} {% endif %}
<div class="signDiv" id="sign^{{i}}" hidden="hidden"> <div class="signDiv" id="sign^{{i}}" hidden="hidden">
<div class="alert alert-warning margin-top" id="allPresentWarning" role="alert" hidden="hidden"> <div class="alert alert-warning margin-top" id="allPresentWarning-{{i}}" role="alert"
hidden="hidden">
<h4 class="alert-heading">請確認是否全班全到Please check if everyone is present!</h4> <h4 class="alert-heading">請確認是否全班全到Please check if everyone is present!</h4>
</div> </div>
<h3 class="margin-top">Please Sign Below 請在下方簽名</h3> <h3 class="margin-top">Please Sign Below 請在下方簽名</h3>
@ -161,7 +162,7 @@
} }
}); });
if (cnt == 0) { if (cnt == 0) {
$('#allPresentWarning').removeAttr('hidden'); $('#allPresentWarning-' + period).removeAttr('hidden');
} }
var canvas = document.getElementById("signature_pad^" + period); var canvas = document.getElementById("signature_pad^" + period);
@ -181,6 +182,7 @@
} }
}); });
resizeCanvas(); resizeCanvas();
$('html,body').unbind().animate({ scrollTop: document.getElementById("sign^" + period).offsetTop - $(".sticky-top").outerHeight() - 10 }, 'slow');
} }
function unCheckAbs(string) { function unCheckAbs(string) {
document.getElementById('absent^' + string).checked = false; document.getElementById('absent^' + string).checked = false;

View file

@ -280,6 +280,7 @@
} }
}); });
resizeCanvas(); resizeCanvas();
$('html,body').unbind().animate({ scrollTop: $("#finalCheck").offset().top - $(".sticky-top").outerHeight() - 10 }, 'slow');
} }
function afterSelAbs(period) { function afterSelAbs(period) {
var tobeformArr = []; var tobeformArr = [];