aboutsummaryrefslogtreecommitdiffstats
path: root/COPYING
diff options
context:
space:
mode:
authorTeddy Wing2017-09-29 00:22:45 +0200
committerTeddy Wing2017-09-29 00:56:13 +0200
commit6e9040f7ef45ef8262cdbebab719cd961c5b1147 (patch)
tree43543915e052d66e2b3d845cb2103d643191da7c /COPYING
parenta56fc2cdc16929216bea1db71b76641152a9c00b (diff)
downloadGitHub-Apple-Option-P-to-Preview-6e9040f7ef45ef8262cdbebab719cd961c5b1147.tar.bz2
Enable listener for all comment fields including future ones
The keyboard shortcut now works on all comment fields, including those that are created after page load. Thanks to this Stack Overflow answer from 'adeneo' and Suraj Jain: https://stackoverflow.com/questions/20330945/how-to-addeventlistener-to-future-dom-elements/20331016#20331016 It takes advantage of the fact that JavaScript events bubble. We attach an event to `<body>`, which we can be sure will always be there (even across GitHub's Turbolinks), and in the keydown event listener check to see whether we were called on the right element.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions