From 7fb981d7780d7b1e48251027d7b3ee4e5cdef194 Mon Sep 17 00:00:00 2001 From: rainbownapkin Date: Fri, 6 Dec 2024 02:41:32 -0500 Subject: [PATCH] Fix userlist to properly handle longboi usernames --- www/js/channel/userlist.js | 2 +- www/js/utils.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/www/js/channel/userlist.js b/www/js/channel/userlist.js index 83046ad..e267dac 100644 --- a/www/js/channel/userlist.js +++ b/www/js/channel/userlist.js @@ -20,7 +20,7 @@ class userList{ this.client = client //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 this.userColors = [ diff --git a/www/js/utils.js b/www/js/utils.js index 748bdbc..97f332a 100644 --- a/www/js/utils.js +++ b/www/js/utils.js @@ -151,7 +151,7 @@ class canopyUXUtils{ } static clickDragger = class{ - constructor(handle, element, leftHandle = true){ + constructor(handle, element, leftHandle = true, parent){ //Pull needed nodes this.handle = document.querySelector(handle); this.element = document.querySelector(element); @@ -165,6 +165,9 @@ class canopyUXUtils{ //Little hacky but it could be worse :P 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 this.setupInput(); } @@ -244,6 +247,12 @@ class canopyUXUtils{ //call end drag to finish the job this.endDrag(); } + + //If we have a parent dragger + if(this.parent != null){ + //Make sure to fix it's cutoff too + this.parent.fixCutoff(); + } } } }