mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-24 14:07:03 +01:00
Default normal scrollbar unless theme param set
This commit is contained in:
parent
5ffa7dbca7
commit
52c076e667
@ -74,7 +74,7 @@ QUERY_PARAMETERS = [
|
||||
"options": [
|
||||
{
|
||||
"name": "light",
|
||||
"default": True,
|
||||
"default": False,
|
||||
},
|
||||
{
|
||||
"name": "dark",
|
||||
@ -185,7 +185,7 @@ QUERY_PARAMETERS = [
|
||||
{
|
||||
"name": "showscrollbar",
|
||||
"type": "boolean",
|
||||
"description": "Shows the scrollbar permanently without autohiding.",
|
||||
"description": "Shows the scrollbar permanently without autohiding. (Requires the scrollbar theme param to be set)",
|
||||
"example": "true",
|
||||
"options": [
|
||||
{
|
||||
|
@ -328,7 +328,11 @@
|
||||
if (!has_already_been_initially_resized) {
|
||||
has_already_been_initially_resized = true;
|
||||
if (has_handled_noscroll) {
|
||||
if (getParameterByName("scrollbartheme")) {
|
||||
$("main").mCustomScrollbar("scrollTo", "bottom", {scrollEasing:"easeOut"});
|
||||
} else {
|
||||
$("main").animate({ scrollTop: $("#chatcontent").height() }, "slow");
|
||||
}
|
||||
} else {
|
||||
has_handled_noscroll = true;
|
||||
Materialize.toast('Continue scrolling to read on...', 5000);
|
||||
@ -359,13 +363,12 @@
|
||||
showScrollbar = 0;
|
||||
}
|
||||
var scrollbarTheme = getParameterByName("scrollbartheme");
|
||||
if (!scrollbarTheme) {
|
||||
scrollbarTheme = "light";
|
||||
}
|
||||
if (scrollbarTheme) {
|
||||
$("main").mCustomScrollbar({
|
||||
autoHideScrollbar: !showScrollbar,
|
||||
theme: scrollbarTheme
|
||||
});
|
||||
}
|
||||
|
||||
if (disabled) {
|
||||
Materialize.toast('This server is currently disabled. If you are an administrator of this server, please get in touch with a TitanEmbeds team member to lift the ban.', 100000);
|
||||
@ -1325,6 +1328,7 @@
|
||||
has_handled_noscroll = true;
|
||||
Materialize.toast('Continue scrolling to read on...', 5000);
|
||||
} else {
|
||||
if (getParameterByName("scrollbartheme")) {
|
||||
if ($(window).height() < $("main .mCSB_container").height()) {
|
||||
$("main .mCSB_container").animate({
|
||||
top: -1 * ($("main .mCSB_container").height() - $(window).height())
|
||||
@ -1332,6 +1336,9 @@
|
||||
$("main").mCustomScrollbar("update");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$("main").animate({ scrollTop: $("#chatcontent").height() }, "slow");
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#chatcontent').linkify({
|
||||
|
Loading…
Reference in New Issue
Block a user