mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
updates
This commit is contained in:
parent
ecf68fa4ce
commit
915b56b2bc
2 changed files with 9 additions and 5 deletions
|
@ -346,7 +346,7 @@ if ($obj->doNotProcessNotifications) {
|
|||
itemsArray.icon = 'fas fa-video';
|
||||
itemsArray.type = 'info';
|
||||
itemsArray.html = '<span class="label label-danger liveNow faa-flash faa-slow animated" style="display:inline-block; float:right;">LIVE NOW</span>';
|
||||
addTemplateFromArray(itemsArray);
|
||||
addTemplateFromArray(itemsArray, false);
|
||||
}
|
||||
|
||||
<?php
|
||||
|
|
|
@ -23,7 +23,7 @@ function getTemplateFromArray(itemsArray) {
|
|||
return template;
|
||||
}
|
||||
|
||||
function addTemplateFromArray(itemsArray) {
|
||||
function addTemplateFromArray(itemsArray, prepend) {
|
||||
if (typeof itemsArray === 'function') {
|
||||
return false;
|
||||
}
|
||||
|
@ -43,7 +43,11 @@ function addTemplateFromArray(itemsArray) {
|
|||
var selector = '#topMenuUserNotifications ul .list-group .priority' + priority;
|
||||
//console.log('addTemplateFromArray prepend', selector);
|
||||
try {
|
||||
$(selector).prepend(template);
|
||||
if(prepend){
|
||||
$(selector).prepend(template);
|
||||
}else{
|
||||
$(selector).append(template);
|
||||
}
|
||||
updateUserNotificationCount();
|
||||
} catch (e) {
|
||||
//console.log('addTemplateFromArray prepend error', selector, e);
|
||||
|
@ -66,7 +70,7 @@ function cleanUpTemplate(template) {
|
|||
|
||||
function userNotification(itemsArray, toast, customTitle) {
|
||||
console.log('UserNotification::userNotification', itemsArray, toast, customTitle);
|
||||
addTemplateFromArray(itemsArray);
|
||||
addTemplateFromArray(itemsArray, true);
|
||||
|
||||
var title = itemsArray.title;
|
||||
if (!empty(customTitle)) {
|
||||
|
@ -155,7 +159,7 @@ async function getUserNotification() {
|
|||
if (typeof itemsArray === 'function') {
|
||||
continue;
|
||||
}
|
||||
addTemplateFromArray(itemsArray);
|
||||
addTemplateFromArray(itemsArray, true);
|
||||
}
|
||||
updateUserNotificationCount();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue