Skip to content
Snippets Groups Projects
Commit fba5aa6c authored by onny's avatar onny
Browse files

fix no favorites screen

parent 6a447f01
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,29 @@ $(function(){
};
});
/* Playbutton click */
$('#playbutton').click(function() {
var music = document.getElementById('player');
if (music.paused && $("#player").attr("src") != "") {
music.play();
} else {
music.pause();
}
});
/* Click on menus */
$('a.nav-icon-files').click(function() {
switch_menu(0);
});
$('a.nav-icon-recent').click(function() {
switch_menu(1);
});
$('a.nav-icon-favorites').click(function() {
switch_menu(2);
});
/* ==============
// ACTIONS //
/===============*/
......@@ -165,7 +188,7 @@ $(function(){
$.each(data, function(i, station) {
var isstarred = ""
for (var fav_station in fav_stations) {
if (fav_stations[fav_station]["stationid"] == station['id']) {
isstarred = "starred";
......@@ -201,7 +224,12 @@ $(function(){
for (var station in data) {
stations.push(data[station]["stationid"]);
};
query_stations(stations);
if (stations.length == 0) {
$('#filestable').hide();
$('#emptycontent').removeClass('hidden');
} else {
query_stations(stations);
};
});
};
......@@ -268,19 +296,7 @@ $(function(){
break;
}
}, 500);
}
$('a.nav-icon-files').click(function() {
switch_menu(0);
});
$('a.nav-icon-recent').click(function() {
switch_menu(1);
});
$('a.nav-icon-favorites').click(function() {
switch_menu(2);
});
};
function mySearch(query){
if (query != "") {
......@@ -299,15 +315,6 @@ $(function(){
}
});
$('#playbutton').click(function() {
var music = document.getElementById('player');
if (music.paused && $("#player").attr("src") != "") {
music.play();
} else {
music.pause();
}
});
$('#volumeslider').slider({
orientation: "horizontal",
value: player.volume,
......
......@@ -33,6 +33,13 @@
<div id="app-content">
<div id="app-content-files" class="viewcontainer">
<!-- <div class="mask transparent icon-loading"></div> -->
<div id="emptycontent" class="hidden">
<div class="icon-starred"></div>
<h2><?php p($l->t('No favorites yet')); ?></h2>
<p><?php p($l->t('Stations you mark as favorite will show up here')); ?></p>
</div>
<table id="filestable" data-preview-x="32" data-preview-y="32">
<thead>
<tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment