File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
LearningHub.Nhs.WebUI/Scripts/vuesrc/notification Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 7474 <i :class =" ['fal fa-envelope' + (notification.readOnDate != null ? '-open text-success' : '')]" >  ; </i >
7575 <a href =" #" @click =" showNotification(notification)" >{{ notification.title }}</a >
7676 </div >
77-
78- <a href =" #deleteModalButton" data-toggle =" modal" @click =" deleteNotification( )" aria-label =" Delete" v-if =" notification.userDismissable" >
77+
78+ <a href =" #deleteModalButton" data-toggle =" modal" @click =" selectNotification(notification )" aria-label =" Delete" v-if =" notification.userDismissable" >
7979 <i class =" fas fa-ellipsis-h fa-lg" style =" color : #435563 ;" ></i >
8080 </a >
8181 </div >
173173 .catch (e => console .log (e ));
174174 }
175175 },
176- async deleteNotification() {
176+ async deleteNotification() {
177177 await axios .delete (
178178 ' /api/notification/' + this .selectedNotification .notificationId + ' ?userNotificationId=' + this .selectedNotification .id )
179179 .catch (e => console .log (e ));
Original file line number Diff line number Diff line change 8787 <div class =" modal-dialog modal-dialog-centered" role =" document" >
8888 <div class =" modal-content" >
8989 <div class =" modal-header pr-0 pt-0" >
90- <button type =" button" class =" close" data-dismiss = " modal " aria-label =" Close" >
90+ <button type =" button" class =" close" @click = " closeConfirmation " aria-label =" Close" >
9191 <i class =" fa-solid fa-xmark" ></i >
9292 </button >
9393 </div >
9898 </p >
9999 </div >
100100 <div class =" modal-footer justify-content-center" >
101- <button type =" button" class =" nhsuk-button nhsuk-button--secondary mr-4" data-dismiss = " modal " >Cancel</button >
101+ <button type =" button" class =" nhsuk-button nhsuk-button--secondary mr-4" @click = " closeConfirmation " >Cancel</button >
102102 <button type =" button" class =" nhsuk-button" @click =" deleteNotification" >Delete</button >
103103 </div >
104104 </div >
143143 $ (' #deleteModalButton' ).modal (' hide' );
144144 $ (' #deleteModal' ).modal ();
145145 },
146+ closeConfirmation() {
147+ if (document .activeElement instanceof HTMLElement ) {
148+ document .activeElement .blur ();
149+ }
150+ document .body .focus ();
151+ setTimeout (() => { $ (' #deleteModal' ).modal (' hide' ); }, 10 );
152+ },
146153 showNotification(notification : NotificationModel ) {
147154 this .selectedNotification = notification ;
148155 this .showMessage = true ;
155162 },
156163 async deleteNotification() {
157164 await this .getSelectedComponent ().deleteNotification ();
158- $ ( ' #deleteModal ' ). modal ( ' hide ' );
165+ this . closeConfirmation ( );
159166 this .showMessage = false ;
160167 },
161168 notificationTypeContent() {
You can’t perform that action at this time.
0 commit comments