Skip to content

Commit dd99d16

Browse files
committed
reduce listener scope to element
1 parent cbf424c commit dd99d16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

inst/app/www/document_code_js.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ function updateSelection() {
7070

7171
// Function to send calculated positions to Shiny
7272
$( document ).ready(function() {
73-
document.addEventListener('mouseup', updateSelection);
74-
document.addEventListener('keyup', updateSelection);
75-
document.addEventListener('touchend', updateSelection);
73+
var el = document.getElementById("document_code_ui_1-focal_text")
74+
el.addEventListener('mouseup', updateSelection);
75+
el.addEventListener('keyup', updateSelection);
76+
el.addEventListener('touchend', updateSelection);
7677
})
7778

7879
// Obtain information from iframe and send to Shiny

0 commit comments

Comments
 (0)