Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Aug 29, 2023
1 parent f8c5d20 commit 33837ad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,9 @@ let referencePane = {
this.$header.appendChild(this.$headerText);
this.$headerRefId = document.createElement('a');
this.$header.appendChild(this.$headerRefId);
this.$header.addEventListener('pointerdown', e => { this.dragStart(e); });
this.$header.addEventListener('pointerdown', e => {
this.dragStart(e);
});

this.$closeButton = document.createElement('span');
this.$closeButton.setAttribute('id', 'references-pane-close');
Expand Down Expand Up @@ -846,13 +848,14 @@ let referencePane = {
dragStart(pointerDownEvent) {
let startingMousePos = pointerDownEvent.clientY;
let startingHeight = parseInt(getComputedStyle(this.$container).height);
let moveListener = (pointerMoveEvent) => {
let moveListener = pointerMoveEvent => {
if (pointerMoveEvent.buttons === 0) {
removeListeners();
return;
}
let desiredHeight = startingHeight - (pointerMoveEvent.clientY - startingMousePos);
this.$container.style.height = Math.max(50, Math.min(visualViewport.height - 150, desiredHeight)) + 'px';
this.$container.style.height =
Math.max(50, Math.min(visualViewport.height - 150, desiredHeight)) + 'px';
};
let listenerOptions = { capture: true, passive: true };
let removeListeners = () => {
Expand Down

0 comments on commit 33837ad

Please sign in to comment.