Skip to content

Commit

Permalink
#0018942: Add a "back to top" button
Browse files Browse the repository at this point in the history
  • Loading branch information
mariez committed Aug 10, 2018
1 parent 754ad72 commit 8ed82bc
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions footer_minified.inc
Expand Up @@ -20,8 +20,11 @@
</div> <!-- end #content-->

</div> <!-- end #container-->
<a id="back-to-top" href="#" class="btn btn-info btn-lg back-to-top" role="button" title="Click to return on the top page" data-toggle="tooltip" data-placement="left"><span class="glyphicon glyphicon-chevron-up"></span></a>

</div> <!-- end .container-fluid -->


<script type="text/javascript" src="ui/phplist-ui-bootlist/js/jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="js/phplistapp.js"></script>
<script type="text/javascript" src="ui/phplist-ui-bootlist/js/dist/phpList_ui_bootlist.min.js"></script>
Expand Down
18 changes: 18 additions & 0 deletions js/dist/phpList_ui_bootlist.js
Expand Up @@ -2481,6 +2481,24 @@ $(document).ready(function(){
if(window.location.href.indexOf("id=list_categories") > -1)
location.reload();
});

/* Back to top */
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
$('#back-to-top').tooltip('show');


}); /* <-- end document.ready */
;/*!
Expand Down
10 changes: 5 additions & 5 deletions js/dist/phpList_ui_bootlist.min.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions js/phpList3ToBootstrap.js
Expand Up @@ -495,5 +495,23 @@ $(document).ready(function(){
if(window.location.href.indexOf("id=list_categories") > -1)
location.reload();
});

/* Back to top */
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
$('#back-to-top').tooltip('show');


}); /* <-- end document.ready */
7 changes: 7 additions & 0 deletions less/legacy.less
Expand Up @@ -192,6 +192,13 @@ body.messages table.messagesendstats{ width: 49%; float: left; margin-left: 1%;}
h1,h2,h3,h4,h5,h6{display:inline;font-weight:bold;font-size:inherit}
p{margin-top:0}
}
.back-to-top {
cursor: pointer;
position: fixed;
bottom: 20px;
right: 20px;
display:none;
}


/* # header *******************/
Expand Down

0 comments on commit 8ed82bc

Please sign in to comment.