Monorepo for Tangled tangled.org

appview/pages/templates/fragments/resizeable: add resize on double click #1228

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xu5apv6kmu5jp7g5hwdnej42/sh.tangled.repo.pull/3mi2gnrf6p522
+9
Diff #0
+9
appview/pages/templates/fragments/resizeable.html
··· 15 15 this.handleMouseDown = this.handleMouseDown.bind(this); 16 16 this.handleMouseMove = this.handleMouseMove.bind(this); 17 17 this.handleMouseUp = this.handleMouseUp.bind(this); 18 + this.handleDoubleClick = this.handleDoubleClick.bind(this); 18 19 19 20 this.init(); 20 21 } 21 22 22 23 init() { 23 24 this.resizer.addEventListener('mousedown', this.handleMouseDown); 25 + this.resizer.addEventListener('dblclick', this.handleDoubleClick); 24 26 } 25 27 26 28 handleMouseDown(e) { ··· 86 88 document.removeEventListener('mouseup', this.handleMouseUp); 87 89 } 88 90 91 + handleDoubleClick(e) { 92 + e.preventDefault(); 93 + this.target.style.width = ''; 94 + this.target.style.flexShrink = ''; 95 + } 96 + 89 97 destroy() { 90 98 this.resizer.removeEventListener('mousedown', this.handleMouseDown); 99 + this.resizer.removeEventListener('dblclick', this.handleDoubleClick); 91 100 document.removeEventListener('mousemove', this.handleMouseMove); 92 101 document.removeEventListener('mouseup', this.handleMouseUp); 93 102 }

History

1 round 0 comments
sign up or login to add to the discussion
eti.tf submitted #0
1 commit
expand
appview/pages/templates/fragments/resizeable: add resize on double click
no conflicts, ready to merge
expand 0 comments