From c718012c3e76e8a10c35da3fa1dc1532d1454bfc Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 8 Sep 2021 07:37:07 -0400 Subject: [PATCH] remove unused code --- docs/assets/plugins/code-block/code-block.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/assets/plugins/code-block/code-block.js b/docs/assets/plugins/code-block/code-block.js index a308e3333..54eba8b3e 100644 --- a/docs/assets/plugins/code-block/code-block.js +++ b/docs/assets/plugins/code-block/code-block.js @@ -119,26 +119,10 @@ document.documentElement.removeEventListener('touchend', dragStop, false); }; - const handleKeyDown = event => { - if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) { - const currentWidth = preview.clientWidth; - const maxWidth = preview.parentElement.clientWidth; - const incr = event.shiftKey ? 100 : 10; - - event.preventDefault(); - - if (event.key === 'ArrowLeft') setWidth(currentWidth - incr); - if (event.key === 'ArrowRight') setWidth(currentWidth + incr); - if (event.key === 'Home') setWidth(0); - if (event.key === 'End') setWidth(maxWidth); - } - }; - const setWidth = width => (preview.style.width = width + 'px'); resizer.addEventListener('mousedown', dragStart); resizer.addEventListener('touchstart', dragStart); - resizer.addEventListener('keydown', handleKeyDown); }, false); }); });