mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-14 16:38:39 +00:00
allow buttons for message log
This commit is contained in:
parent
0fccd49375
commit
25db82cdf9
|
|
@ -68,17 +68,33 @@ export class AppNotification
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.primaryButton) {
|
if (!msg.primaryButton) {
|
||||||
output.querySelector('.primary-button').remove();
|
const primary = output.querySelector('.primary-button');
|
||||||
|
|
||||||
|
if (primary) {
|
||||||
|
primary.remove();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
output.querySelector('.primary-button').innerHTML = msg.primaryButton.text;
|
const primary = output.querySelector('.primary-button');
|
||||||
output.querySelector('.primary-button').addEventListener('click', msg.primaryButton.callback);
|
|
||||||
|
if (primary) {
|
||||||
|
primary.innerHTML = msg.primaryButton.text;
|
||||||
|
primary.addEventListener('click', msg.primaryButton.callback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.secondaryButton) {
|
if (!msg.secondaryButton) {
|
||||||
output.querySelector('.secondary-button').remove();
|
const secondary = output.querySelector('.secondary-button');
|
||||||
|
|
||||||
|
if (secondary) {
|
||||||
|
secondary.remove();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
output.querySelector('.secondary-button').innerHTML = msg.secondaryButton.text;
|
const secondary = output.querySelector('.secondary-button');
|
||||||
output.querySelector('.secondary-button').addEventListener('click', msg.secondaryButton.callback);
|
|
||||||
|
if (secondary) {
|
||||||
|
secondary.innerHTML = msg.secondaryButton.text;
|
||||||
|
secondary.addEventListener('click', msg.secondaryButton.callback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tpl.parentNode.appendChild(output);
|
tpl.parentNode.appendChild(output);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user