mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27: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": [
|
"options": [
|
||||||
{
|
{
|
||||||
"name": "light",
|
"name": "light",
|
||||||
"default": True,
|
"default": False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dark",
|
"name": "dark",
|
||||||
@ -185,7 +185,7 @@ QUERY_PARAMETERS = [
|
|||||||
{
|
{
|
||||||
"name": "showscrollbar",
|
"name": "showscrollbar",
|
||||||
"type": "boolean",
|
"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",
|
"example": "true",
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
|
@ -328,7 +328,11 @@
|
|||||||
if (!has_already_been_initially_resized) {
|
if (!has_already_been_initially_resized) {
|
||||||
has_already_been_initially_resized = true;
|
has_already_been_initially_resized = true;
|
||||||
if (has_handled_noscroll) {
|
if (has_handled_noscroll) {
|
||||||
|
if (getParameterByName("scrollbartheme")) {
|
||||||
$("main").mCustomScrollbar("scrollTo", "bottom", {scrollEasing:"easeOut"});
|
$("main").mCustomScrollbar("scrollTo", "bottom", {scrollEasing:"easeOut"});
|
||||||
|
} else {
|
||||||
|
$("main").animate({ scrollTop: $("#chatcontent").height() }, "slow");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
has_handled_noscroll = true;
|
has_handled_noscroll = true;
|
||||||
Materialize.toast('Continue scrolling to read on...', 5000);
|
Materialize.toast('Continue scrolling to read on...', 5000);
|
||||||
@ -359,13 +363,12 @@
|
|||||||
showScrollbar = 0;
|
showScrollbar = 0;
|
||||||
}
|
}
|
||||||
var scrollbarTheme = getParameterByName("scrollbartheme");
|
var scrollbarTheme = getParameterByName("scrollbartheme");
|
||||||
if (!scrollbarTheme) {
|
if (scrollbarTheme) {
|
||||||
scrollbarTheme = "light";
|
|
||||||
}
|
|
||||||
$("main").mCustomScrollbar({
|
$("main").mCustomScrollbar({
|
||||||
autoHideScrollbar: !showScrollbar,
|
autoHideScrollbar: !showScrollbar,
|
||||||
theme: scrollbarTheme
|
theme: scrollbarTheme
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (disabled) {
|
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);
|
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;
|
has_handled_noscroll = true;
|
||||||
Materialize.toast('Continue scrolling to read on...', 5000);
|
Materialize.toast('Continue scrolling to read on...', 5000);
|
||||||
} else {
|
} else {
|
||||||
|
if (getParameterByName("scrollbartheme")) {
|
||||||
if ($(window).height() < $("main .mCSB_container").height()) {
|
if ($(window).height() < $("main .mCSB_container").height()) {
|
||||||
$("main .mCSB_container").animate({
|
$("main .mCSB_container").animate({
|
||||||
top: -1 * ($("main .mCSB_container").height() - $(window).height())
|
top: -1 * ($("main .mCSB_container").height() - $(window).height())
|
||||||
@ -1332,6 +1336,9 @@
|
|||||||
$("main").mCustomScrollbar("update");
|
$("main").mCustomScrollbar("update");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$("main").animate({ scrollTop: $("#chatcontent").height() }, "slow");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#chatcontent').linkify({
|
$('#chatcontent').linkify({
|
||||||
|
Loading…
Reference in New Issue
Block a user