Skip to content

Commit b496d91

Browse files
v12.3.2
1 parent 26f77ec commit b496d91

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CollapsibleUI Patch Notes
22

3+
### v12.3.2:
4+
* Fixed profile panel visual glitches on resize
5+
36
### v12.3.1:
47
* Added BetterAnimations compatibility
58

CollapsibleUI.plugin.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author programmer2514
44
* @authorId 563652755814875146
55
* @description A feature-rich BetterDiscord plugin that reworks the Discord UI to be significantly more modular
6-
* @version 12.3.1
6+
* @version 12.3.2
77
* @donate https://ko-fi.com/benjaminpryor
88
* @patreon https://www.patreon.com/BenjaminPryor
99
* @website https://github.com/programmer2514/BetterDiscord-CollapsibleUI
@@ -155,14 +155,14 @@ const settings = {
155155
const config = {
156156
changelog: [
157157
{
158-
title: '12.3.1',
158+
title: '12.3.2',
159159
type: 'added',
160160
items: [
161-
'Added BetterAnimations compatibility',
161+
'Fixed profile panel visual glitches on resize',
162162
],
163163
},
164164
{
165-
title: '1.0.0 - 12.3.0',
165+
title: '1.0.0 - 12.3.1',
166166
type: 'added',
167167
items: [
168168
'See the full changelog here: https://programmer2514.github.io/?l=cui-changelog',
@@ -1150,6 +1150,7 @@ const modules = {
11501150
get callButtons() { return this._callButtons ?? (this._callButtons = runtime.api.Webpack.getByKeys('controlButton', 'wrapper', 'buttonContainer')); },
11511151
get userAreaButtons() { return this._userAreaButtons ?? (this._userAreaButtons = runtime.api.Webpack.getByKeys('actionButtons', 'micTestButton', 'buttonIcon')); },
11521152
get scroller() { return this._scroller ?? (this._scroller = runtime.api.Webpack.getByKeys('wrapper', 'scroller', 'discoveryIcon')); },
1153+
get profileWrappers() { return this._profileWrappers ?? (this._profileWrappers = runtime.api.Webpack.getByKeys('header', 'footerButton', 'widgetBreadcrumb', 'wishlistBreadcrumb')); },
11531154
};
11541155

11551156
const elements = {
@@ -1658,41 +1659,46 @@ const styles = {
16581659
{
16591660
_index: constants.I_USER_PROFILE,
16601661
get _init() {
1661-
if (document.querySelector(`.${modules.panel?.outer} header > svg`)) document.querySelector(`.${modules.panel?.outer} header > svg`).style.maxHeight = document.querySelector(`.${modules.panel?.outer} header > svg`).style.minHeight;
1662-
document.querySelector(`.${modules.panel?.outer} header > svg > mask > rect`)?.setAttribute('width', '500%');
1663-
document.querySelector(`.${modules.panel?.outer} header > svg`)?.removeAttribute('viewBox');
1662+
let panelPath = `.${modules.guilds?.content} .${modules.panel?.outer}`;
1663+
let headerPath = `${panelPath} .${modules.profileWrappers?.header}`;
1664+
1665+
if (document.querySelector(`${headerPath} > svg`))
1666+
document.querySelector(`${headerPath} > svg`).style.maxHeight = document.querySelector(`${headerPath} > svg`).style.minHeight;
1667+
document.querySelector(`${headerPath} > svg > mask > rect`)?.setAttribute('width', '500%');
1668+
document.querySelector(`${headerPath} > svg`)?.removeAttribute('viewBox');
1669+
16641670
return this.__init ?? (this.__init = [`${runtime.meta.name}-userProfile_init`, `
1665-
.${modules.guilds?.content} .${modules.panel?.outer} {
1671+
${panelPath} {
16661672
max-width: var(--cui-user-profile-width) !important;
16671673
width: var(--cui-user-profile-width) !important;
16681674
min-width: var(--cui-user-profile-width) !important;
16691675
transition: max-width var(--cui-transition-speed), width var(--cui-transition-speed), min-width var(--cui-transition-speed);
16701676
min-height: 100% !important;
16711677
}
16721678
1673-
.${modules.guilds?.content} .${modules.panel?.outer} .${modules.panel?.inner} {
1679+
${panelPath} .${modules.panel?.inner} {
16741680
border-left: 1px solid var(--border-subtle) !important;
16751681
}
16761682
1677-
.${modules.guilds?.content} .${modules.panel?.outer} > * {
1683+
${panelPath} > * {
16781684
width: 100% !important;
16791685
}
16801686
1681-
.${modules.guilds?.content} .${modules.panel?.outer} header > svg {
1687+
${headerPath} > svg {
16821688
min-width: 100% !important;
16831689
}
16841690
1685-
.${modules.guilds?.content} .${modules.panel?.outer} header > svg > mask > rect {
1691+
${headerPath} > svg > mask > rect {
16861692
width: 500% !important;
16871693
}
16881694
1689-
.${modules.guilds?.content} .${modules.panel?.outer} .${modules.effects?.effect} {
1695+
${panelPath} .${modules.effects?.effect} {
16901696
min-height: 100% !important;
16911697
}
16921698
16931699
${(settings.userProfileWidth)
16941700
? `
1695-
.${modules.guilds?.content} .${modules.panel?.outer}:before {
1701+
${panelPath}:before {
16961702
cursor: e-resize;
16971703
z-index: 200;
16981704
position: absolute;
@@ -1750,9 +1756,11 @@ const styles = {
17501756
`.replace(/\s+/g, ' ')]);
17511757
},
17521758
_clear: function () {
1753-
document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg`)?.style.removeProperty('max-height');
1754-
document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg > mask > rect`)?.setAttribute('width', '100%');
1755-
document.querySelector(`.${modules.guilds?.content} .${modules.panel?.outer} header > svg`)?.setAttribute('viewBox', `0 0 ${parseInt(document.querySelector(`.${modules.panel?.outer} header > svg`)?.style.minWidth)} ${parseInt(document.querySelector(`.${modules.panel?.outer} header > svg`)?.style.minHeight)}`);
1759+
let headerPath = `.${modules.guilds?.content} .${modules.panel?.outer} .${modules.profileWrappers?.header}`;
1760+
1761+
document.querySelector(`${headerPath} > svg`)?.style.removeProperty('max-height');
1762+
document.querySelector(`${headerPath} > svg > mask > rect`)?.setAttribute('width', '100%');
1763+
document.querySelector(`${headerPath} > svg`)?.setAttribute('viewBox', `0 0 ${parseInt(document.querySelector(`${headerPath} > svg`)?.style.minWidth)} ${parseInt(document.querySelector(`${headerPath} > svg`)?.style.minHeight)}`);
17561764
},
17571765
...styleFunctions,
17581766
},

0 commit comments

Comments
 (0)