Skip to content

Commit

Permalink
Disabled text selection when dragging font size slider
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Jun 15, 2024
1 parent 1f0ff02 commit e916b6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions googlegpt/greasemonkey/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.6.14.3
// @version 2024.6.14.4
// @license MIT
// @icon https://media.googlegpt.io/images/icons/googlegpt/black/icon48.png?8652a6e
// @icon64 https://media.googlegpt.io/images/icons/googlegpt/black/icon64.png?8652a6e
Expand Down Expand Up @@ -1232,10 +1232,12 @@
// Add event listeners for dragging knob
let isDragging = false, startX, startLeft;
sliderKnob.addEventListener('mousedown', event => {
isDragging = true ; startX = event.clientX ; startLeft = sliderKnob.offsetLeft })
isDragging = true ; startX = event.clientX ; startLeft = sliderKnob.offsetLeft
answerPre.classList.add('no-user-select') // prevent highlighting from rapid movement
})
appDiv.addEventListener('mousemove', event => {
if (isDragging) moveKnob(startLeft + event.clientX - startX) })
appDiv.addEventListener('mouseup', () => isDragging = false)
appDiv.addEventListener('mouseup', () => { isDragging = false ; answerPre.classList.remove('no-user-select')})

// Add event listener for wheel-scrolling knob
fontSizeSlider.addEventListener('wheel', event => {
Expand Down

0 comments on commit e916b6b

Please sign in to comment.