File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,11 @@ var logInner = document.getElementById("log").innerHTML
135
135
136
136
137
137
// Request permission for notifications
138
- document . addEventListener ( 'DOMContentLoaded' , function ( ) {
138
+ function notificationPermission ( ) {
139
139
if ( Notification . permission !== "granted" ) {
140
140
Notification . requestPermission ( ) ;
141
141
}
142
- } ) ;
142
+ }
143
143
144
144
function sendNotification ( title , body ) {
145
145
if ( Notification . permission === "granted" ) {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ <h1 class="site-title">TCDD-CLI Web</h1>
42
42
< option value ="business "> Business</ option >
43
43
</ select >
44
44
</ div >
45
- < button type ="button " id ="start-search-button " onclick ="startSearch() "> Search for Trips</ button >
45
+ < button type ="button " id ="start-search-button " onclick ="startSearch();notificationPermission(); "> Search for Trips</ button >
46
46
< div id ="statusContainer ">
47
47
< div id ="log "> </ div >
48
48
< div >
You can’t perform that action at this time.
0 commit comments