File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,12 +65,12 @@ function initOnHashChangeAction(domains) {
6565function initShortcuts ( shortcut , backgroundShortcut ) {
6666 $ ( document ) . on ( "keydown" , function ( event ) {
6767 // Shortcut: bind user's combination, if a button exist and event not in a textarea
68- if ( processRightCombinationBasedOnShortcut ( shortcut , event ) && window . idled && $ ( ". github-link:visible" ) [ 0 ] && notAnInput ( event . target ) ) {
68+ if ( processRightCombinationBasedOnShortcut ( shortcut , event ) && window . idled && getVisible ( document . getElementsByClassName ( ' github-link' ) ) && notAnInput ( event . target ) ) {
6969 triggerGitHubLink ( false )
7070 }
7171
7272 // Bacground Shortcut: bind user's combination, if a button exist and event not in a textarea
73- if ( processRightCombinationBasedOnShortcut ( backgroundShortcut , event ) && window . idled && $ ( ". github-link:visible" ) [ 0 ] && notAnInput ( event . target ) ) {
73+ if ( processRightCombinationBasedOnShortcut ( backgroundShortcut , event ) && window . idled && getVisible ( document . getElementsByClassName ( ' github-link' ) ) && notAnInput ( event . target ) ) {
7474 triggerGitHubLink ( true )
7575 }
7676 } )
@@ -92,7 +92,7 @@ function triggerGitHubLink (backgroundOrNot) {
9292 window . idled = false
9393 event = backgroundOrNot ? fakeBackgroundClick ( ) : fakeEvent ( 'click' )
9494
95- $ ( ". github-link:visible" ) [ 0 ] . dispatchEvent ( event )
95+ getVisible ( document . getElementsByClassName ( ' github-link' ) ) . dispatchEvent ( event )
9696 setTimeout ( function ( ) { window . idled = true } , 100 )
9797}
9898
You can’t perform that action at this time.
0 commit comments