Fix userlist to properly handle longboi usernames

This commit is contained in:
rainbow napkin 2024-12-06 02:41:32 -05:00
parent b853d75836
commit 7fb981d778
2 changed files with 11 additions and 2 deletions

View file

@ -20,7 +20,7 @@ class userList{
this.client = client this.client = client
//Click Dragger Object //Click Dragger Object
this.clickDragger = new canopyUXUtils.clickDragger("#chat-panel-users-drag-handle", "#chat-panel-users-div"); this.clickDragger = new canopyUXUtils.clickDragger("#chat-panel-users-drag-handle", "#chat-panel-users-div", true, this.client.chatBox.clickDragger);
//Strings //Strings
this.userColors = [ this.userColors = [

View file

@ -151,7 +151,7 @@ class canopyUXUtils{
} }
static clickDragger = class{ static clickDragger = class{
constructor(handle, element, leftHandle = true){ constructor(handle, element, leftHandle = true, parent){
//Pull needed nodes //Pull needed nodes
this.handle = document.querySelector(handle); this.handle = document.querySelector(handle);
this.element = document.querySelector(element); this.element = document.querySelector(element);
@ -165,6 +165,9 @@ class canopyUXUtils{
//Little hacky but it could be worse :P //Little hacky but it could be worse :P
this.fixWidth = false; this.fixWidth = false;
//we put a click dragger in yo click dragger so you could click and drag while you click and drag
this.parent = parent;
//Setup our event listeners //Setup our event listeners
this.setupInput(); this.setupInput();
} }
@ -244,6 +247,12 @@ class canopyUXUtils{
//call end drag to finish the job //call end drag to finish the job
this.endDrag(); this.endDrag();
} }
//If we have a parent dragger
if(this.parent != null){
//Make sure to fix it's cutoff too
this.parent.fixCutoff();
}
} }
} }
} }