mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Add configurable toast position for notifications
This commit is contained in:
parent
7502151965
commit
51b28cebdb
1 changed files with 5 additions and 1 deletions
|
@ -1342,6 +1342,7 @@ function avideoAlertOnceForceConfirm(title, msg, type) {
|
|||
});
|
||||
}
|
||||
|
||||
var toastPosition = null;
|
||||
function _avideoToast(msg, icon, displayTime = 0) {
|
||||
if (empty(msg)) {
|
||||
msg = '';
|
||||
|
@ -1357,7 +1358,10 @@ function _avideoToast(msg, icon, displayTime = 0) {
|
|||
displayTime = Math.max(readingTimeInSeconds * 1000 + 2000, 7000); // Minimum display time of 7000ms
|
||||
|
||||
}
|
||||
var options = { text: msg, hideAfter: displayTime };
|
||||
var options = { text: msg, hideAfter: displayTime};
|
||||
if(toastPosition && toastPosition !== 'undefined') {
|
||||
options.position = toastPosition;
|
||||
}
|
||||
if (icon) {
|
||||
options.icon = icon;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue