mirror of
https://github.com/unraid/webgui.git
synced 2026-05-07 04:41:03 -05:00
Favorites: hide item when no favorites are present
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Menu="Tasks:2"
|
||||
Type="xmenu"
|
||||
Code="e970"
|
||||
Code="f08a"
|
||||
Cond="@filesize('/boot/config/favorites.cfg')"
|
||||
---
|
||||
<script>
|
||||
function delPage(page) {
|
||||
@@ -8,12 +9,11 @@ function delPage(page) {
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('i.PanelIcon').each(function(){
|
||||
var icon = $(this);
|
||||
var page = icon.closest('a').prop('href').split('/').pop();
|
||||
icon.after('<i class="fa fa-heartbeat favo" title="_(Remove from favorites)_" onclick="delPage("'+page+'");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-heartbeat favo" title="_(Remove from favorites)_" onclick="delPage("'+page+'");return false"></i>');
|
||||
$(this).hover(function(){$(this).find('i.favo').show();},function(){$(this).find('i.favo').hide();});
|
||||
});
|
||||
if ($('i.PanelIcon').length==0) $('#nofavs').show();
|
||||
if ($('div.Panel').length==0) $('#nofavs').show();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user