1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
Daniel Neto 2023-03-09 11:15:01 -03:00
parent ecf68fa4ce
commit 915b56b2bc
2 changed files with 9 additions and 5 deletions

View file

@ -346,7 +346,7 @@ if ($obj->doNotProcessNotifications) {
itemsArray.icon = 'fas fa-video'; itemsArray.icon = 'fas fa-video';
itemsArray.type = 'info'; 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>'; 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 <?php

View file

@ -23,7 +23,7 @@ function getTemplateFromArray(itemsArray) {
return template; return template;
} }
function addTemplateFromArray(itemsArray) { function addTemplateFromArray(itemsArray, prepend) {
if (typeof itemsArray === 'function') { if (typeof itemsArray === 'function') {
return false; return false;
} }
@ -43,7 +43,11 @@ function addTemplateFromArray(itemsArray) {
var selector = '#topMenuUserNotifications ul .list-group .priority' + priority; var selector = '#topMenuUserNotifications ul .list-group .priority' + priority;
//console.log('addTemplateFromArray prepend', selector); //console.log('addTemplateFromArray prepend', selector);
try { try {
$(selector).prepend(template); if(prepend){
$(selector).prepend(template);
}else{
$(selector).append(template);
}
updateUserNotificationCount(); updateUserNotificationCount();
} catch (e) { } catch (e) {
//console.log('addTemplateFromArray prepend error', selector, e); //console.log('addTemplateFromArray prepend error', selector, e);
@ -66,7 +70,7 @@ function cleanUpTemplate(template) {
function userNotification(itemsArray, toast, customTitle) { function userNotification(itemsArray, toast, customTitle) {
console.log('UserNotification::userNotification', itemsArray, toast, customTitle); console.log('UserNotification::userNotification', itemsArray, toast, customTitle);
addTemplateFromArray(itemsArray); addTemplateFromArray(itemsArray, true);
var title = itemsArray.title; var title = itemsArray.title;
if (!empty(customTitle)) { if (!empty(customTitle)) {
@ -155,7 +159,7 @@ async function getUserNotification() {
if (typeof itemsArray === 'function') { if (typeof itemsArray === 'function') {
continue; continue;
} }
addTemplateFromArray(itemsArray); addTemplateFromArray(itemsArray, true);
} }
updateUserNotificationCount(); updateUserNotificationCount();
} }