dont open notes when S is pressed inside of notes window #991
This commit is contained in:
		| @@ -96,22 +96,27 @@ var RevealNotes = (function() { | |||||||
| 		connect(); | 		connect(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// If the there's a 'notes' query set, open directly | 	if( !/receiver/i.test( window.location.search ) ) { | ||||||
| 	if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { |  | ||||||
| 		openNotes(); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	// Open the notes when the 's' key is hit | 		// If the there's a 'notes' query set, open directly | ||||||
| 	document.addEventListener( 'keydown', function( event ) { | 		if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { | ||||||
| 		// Disregard the event if the target is editable or a |  | ||||||
| 		// modifier is present |  | ||||||
| 		if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; |  | ||||||
|  |  | ||||||
| 		if( event.keyCode === 83 ) { |  | ||||||
| 			event.preventDefault(); |  | ||||||
| 			openNotes(); | 			openNotes(); | ||||||
| 		} | 		} | ||||||
| 	}, false ); |  | ||||||
|  | 		// Open the notes when the 's' key is hit | ||||||
|  | 		document.addEventListener( 'keydown', function( event ) { | ||||||
|  | 			// Disregard the event if the target is editable or a | ||||||
|  | 			// modifier is present | ||||||
|  | 			if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; | ||||||
|  |  | ||||||
|  | 			if( event.keyCode === 83 ) { | ||||||
|  | 				event.preventDefault(); | ||||||
|  | 				openNotes(); | ||||||
|  | 			} | ||||||
|  | 		}, false ); | ||||||
|  |  | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return { open: openNotes }; | 	return { open: openNotes }; | ||||||
|  |  | ||||||
| })(); | })(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user