Skip to content

Commit

Permalink
Refactored click event of SubtleAlertPopUp
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeriiMalkov committed Oct 12, 2021
1 parent b8b7413 commit c2477c3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/view/sdl/SubtleAlertPopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ SDL.SubtleAlertPopUp = Em.ContainerView.create(
reason: '',
message: undefined,
click(event) {
const path = event.path;
for(const pathElement of path) {
if ('className' in pathElement
&& typeof pathElement.className === 'string'
&& pathElement.className.match(/resetTimeoutButton|ResetTimeoutPopUp/)) {
return;
}
}
if (document.getElementById('SubtleAlertPopUp').contains(event.target)){
var buttonsDiv = document.getElementById('subtleAlertSoftButtons');
for (var button of buttonsDiv.childNodes) {
Expand All @@ -78,7 +70,8 @@ SDL.SubtleAlertPopUp = Em.ContainerView.create(
this.deactivate();
SDL.SDLController.onActivateSDLApp({ appID: SDL.SubtleAlertPopUp.appID });
SDL.SDLController.onSubtleAlertPressed(SDL.SubtleAlertPopUp.appID);
} else{
} else if(!document.getElementById('right_view').contains(event.target)
&& !document.getElementById('ResetTimeoutPopUp').contains(event.target)) {
SDL.SubtleAlertPopUp.deactivate();
}
},
Expand Down

0 comments on commit c2477c3

Please sign in to comment.