Parcourir la source

Fix horizontal resizing of chats

JC Brand il y a 2 mois
Parent
commit
238d934587
2 fichiers modifiés avec 27 ajouts et 8 suppressions
  1. 3 2
      src/plugins/dragresize/mixin.js
  2. 24 6
      src/types/plugins/dragresize/mixin.d.ts

+ 3 - 2
src/plugins/dragresize/mixin.js

@@ -99,10 +99,11 @@ const DragResizableMixin = {
      * @param {number} width
      */
     setChatBoxWidth(width) {
-        this.style.width = width ? applyDragResistance(width, this.model.get('default_width')) + 'px' : '';
+        const style_width = width ? applyDragResistance(width, this.model.get('default_width')) + 'px' : '';
+        this.style.width = style_width;
         const flyout_el = this.querySelector('.box-flyout');
         if (flyout_el !== null) {
-            flyout_el.style.width = width;
+            flyout_el.style.width = style_width;
         }
     },
 

+ 24 - 6
src/types/plugins/dragresize/mixin.d.ts

@@ -2,16 +2,34 @@ export default DragResizableMixin;
 declare namespace DragResizableMixin {
     function initDragResize(): {
         initDragResize(): any;
-        resizeChatBox(ev: any): void;
+        /**
+         * @param {MouseEvent} ev
+         */
+        resizeChatBox(ev: MouseEvent): void;
         setDimensions(): void;
-        setChatBoxHeight(height: any): void;
-        setChatBoxWidth(width: any): void;
+        /**
+         * @param {number} height
+         */
+        setChatBoxHeight(height: number): void;
+        /**
+         * @param {number} width
+         */
+        setChatBoxWidth(width: number): void;
         adjustToViewport(): void;
     };
-    function resizeChatBox(ev: any): void;
+    /**
+     * @param {MouseEvent} ev
+     */
+    function resizeChatBox(ev: MouseEvent): void;
     function setDimensions(): void;
-    function setChatBoxHeight(height: any): void;
-    function setChatBoxWidth(width: any): void;
+    /**
+     * @param {number} height
+     */
+    function setChatBoxHeight(height: number): void;
+    /**
+     * @param {number} width
+     */
+    function setChatBoxWidth(width: number): void;
     function adjustToViewport(): void;
 }
 //# sourceMappingURL=mixin.d.ts.map