Add constructor to display alerts
This commit is contained in:
parent
fe5437e6d3
commit
20aeb7b75e
1 changed files with 13 additions and 0 deletions
|
@ -21,8 +21,21 @@ export default class alerts {
|
|||
return user_response;
|
||||
}
|
||||
|
||||
constructor(TITLE, MESSAGE) {
|
||||
// Set this message's properties.
|
||||
this.TITLE = TITLE;
|
||||
this.MESSAGE = MESSAGE;
|
||||
|
||||
// Display the message.
|
||||
console.log(TITLE, MESSAGE);
|
||||
try {
|
||||
M.toast({ text: TITLE.concat(`\n`).concat(MESSAGE) });
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
static log(message) {
|
||||
console.log(message);
|
||||
|
||||
try {
|
||||
M.toast({ text: message });
|
||||
} catch (err) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue