-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
custom alert replace window.alert (#1549)
- Use sweetAlert library to provide framework for browser dialogs and notifications. - Add custom css (to match with current window popup UI) to answers.scss - create alert function to wrap around sweetAlert functions with default configuration setup - update all window.alert calls to use alert from alert.js J=SLAP-1524 TEST=manual - serve page using voicesearch functionality with mic access block, see that an alert is display on page with proper UI - check with screen reader and see that the popup message and button can be read
- Loading branch information
Showing
13 changed files
with
221 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import swal from 'sweetalert'; | ||
import DOM from './dom/dom'; | ||
|
||
const defaultAlertOptions = { | ||
closeOnClickOutside: false, | ||
closeOnEsc: false | ||
}; | ||
|
||
export default function alert (message, options = null) { | ||
const opts = options || defaultAlertOptions; | ||
swal(message, opts).then(() => { | ||
DOM.query('.swal-overlay').remove(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.