Usability: Avoided manually scrolling when recommending/approving on Detailsite

...for STGL and lectors Detailview.
Before the downsliding panel was sliding above the window screen, so that
user was forced to scroll down the page. Now it scrolls up by itself.

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-05-03 10:50:52 +02:00
committed by cris-technikum
parent 99b1de542d
commit d23faa6e96
2 changed files with 23 additions and 5 deletions
@@ -37,8 +37,13 @@ $(function(){
if (genehmigung_panel.is(":hidden"))
{
// Show begruendung panel if is hidden
genehmigung_panel.slideDown('slow');
// Show genehmigung panel if is hidden
genehmigung_panel.slideDown(400, function() {
$('html, body').animate({
scrollTop: genehmigung_panel.offset().top // Move genehmigung panel bottom up to be visible within window screen
}, 400);
});
return;
}
});
@@ -99,7 +104,12 @@ $(function(){
if (begruendung_panel.is(":hidden"))
{
// Show begruendung panel if is hidden
begruendung_panel.slideDown('slow');
begruendung_panel.slideDown(400, function() {
$('html, body').animate({
scrollTop: begruendung_panel.offset().top // Move begruendung panel bottom up to be visible within window screen
}, 400);
});
return;
}
});
@@ -44,7 +44,11 @@ $(function(){
if (empfehlung_panel.is(":hidden"))
{
// Show begruendung panel if is hidden
empfehlung_panel.slideDown('slow');
empfehlung_panel.slideDown(400, function() {
$('html, body').animate({
scrollTop: empfehlung_panel.offset().top // Move empfehlung panel bottom up to be visible within window screen
}, 400);
});
return;
}
});
@@ -105,7 +109,11 @@ $(function(){
if (begruendung_panel.is(":hidden"))
{
// Show begruendung panel if is hidden
begruendung_panel.slideDown('slow');
begruendung_panel.slideDown(400, function() {
$('html, body').animate({
scrollTop: begruendung_panel.offset().top // Move begruendung panel bottom up to be visible within window screen
}, 400);
});
return;
}
});