Favorites: fix not all items could be added to favorites

This commit is contained in:
bergware
2024-01-03 12:13:34 +01:00
parent b307e6a373
commit b57f3b0538
2 changed files with 10 additions and 13 deletions

View File

@@ -6,16 +6,15 @@ Code="e924"
<script>
function addPage(page) {
$.post('/webGui/include/MyFavorites.php',{action:'add',page:page},function(){
swal({title:"_(Added to Favorites)_",text:"",type:"success",html:true,confirmButtonText:"_(Ok)_"});
swal({title:"_(Added to Favorites)_",text:"",type:"success",html:true,confirmButtonText:"_(Ok)_"},function(x){refresh();});
});
}
$(function(){
$('i.PanelIcon').each(function(){
var icon = $(this);
var page = icon.closest('a').prop('href').split('/').pop();
icon.after('<i class="fa fa-heart favo" title="_(Add to favorites)_" onclick="addPage(&quot;'+page+'&quot;);return false"></i>');
icon.parent().parent().parent().hover(function(){icon.next().show();},function(){icon.next().hide();});
$('div.Panel').each(function(){
var page = $(this).find('a').prop('href').split('/').pop();
$(this).find('span').append('<i class="fa fa-heart favo" title="_(Add to favorites)_" onclick="addPage(&quot;'+page+'&quot;);return false"></i>');
$(this).hover(function(){$(this).find('i.favo').show();},function(){$(this).find('i.favo').hide();});
});
});
</script>

View File

@@ -6,16 +6,14 @@ Code="e909"
<script>
function addPage(page) {
$.post('/webGui/include/MyFavorites.php',{action:'add',page:page},function(){
swal({title:"_(Added to Favorites)_",text:"",type:"success",html:true,confirmButtonText:"_(Ok)_"});
swal({title:"_(Added to Favorites)_",text:"",type:"success",html:true,confirmButtonText:"_(Ok)_"},function(x){refresh();});
});
}
$(function(){
$('i.PanelIcon').each(function(){
var icon = $(this);
var page = icon.closest('a').prop('href').split('/').pop();
icon.after('<i class="fa fa-heart favo" title="_(Add to favorites)_" onclick="addPage(&quot;'+page+'&quot;);return false"></i>');
icon.parent().parent().parent().hover(function(){icon.next().show();},function(){icon.next().hide();});
$('div.Panel').each(function(){
var page = $(this).find('a').prop('href').split('/').pop();
$(this).find('span').append('<i class="fa fa-heart favo" title="_(Add to favorites)_" onclick="addPage(&quot;'+page+'&quot;);return false"></i>');
$(this).hover(function(){$(this).find('i.favo').show();},function(){$(this).find('i.favo').hide();});
});
});
</script>