File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -158,20 +158,32 @@ function PhpbbWebpush() {
158158
159159 const allowBtn = document . getElementById ( 'wpn_popup_allow' ) ;
160160 const declineBtn = document . getElementById ( 'wpn_popup_decline' ) ;
161+ const overlay = document . getElementById ( 'wpn_popup_prompt' ) ;
161162
162163 if ( allowBtn ) {
163- allowBtn . addEventListener ( 'click' , ( ) => {
164+ allowBtn . addEventListener ( 'click' , ( event ) => {
165+ event . stopPropagation ( ) ;
164166 popup . style . display = 'none' ;
165167 subscribeButtonHandler ( { preventDefault : ( ) => { } } ) ;
166168 } ) ;
167169 }
168170
169171 if ( declineBtn ) {
170- declineBtn . addEventListener ( 'click' , ( ) => {
172+ declineBtn . addEventListener ( 'click' , ( event ) => {
173+ event . stopPropagation ( ) ;
171174 popup . style . display = 'none' ;
172175 setDeclined ( ) ;
173176 } ) ;
174177 }
178+
179+ if ( overlay ) {
180+ overlay . addEventListener ( 'click' , ( event ) => {
181+ if ( event . target === overlay ) {
182+ popup . style . display = 'none' ;
183+ setDeclined ( ) ;
184+ }
185+ } ) ;
186+ }
175187 }
176188
177189 /**
You can’t perform that action at this time.
0 commit comments