From af840c41f9464fa52aa9d88e3271f9df934c262a Mon Sep 17 00:00:00 2001 From: Alib Date: Thu, 18 Mar 2010 13:36:30 +0100 Subject: added Show ALl button for channel list to prevent animation bug and slowness --- js/istreamdev.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/js/istreamdev.js b/js/istreamdev.js index 2218667..11a08d4 100644 --- a/js/istreamdev.js +++ b/js/istreamdev.js @@ -58,12 +58,6 @@ $.getJSON("bin/backend.php", audio_path = data.audio_path; } ); -//streamdev_server = "http://127.0.0.1:3000/TS/"; -//rec_path = "/video/"; -//video_path = "/mnt/media/Video/"; -//audio_path = "/mnt/media/Music/"; - - //Goto home $('#home_but').tap(function(event) { @@ -211,7 +205,7 @@ $('#categories ul#cat_menu a').tap(function(event) { return false; }); -$('#channels ul#chan_menu a').tap(function(event) { +$('#channels ul#chan_menu .chan_but').tap(function(event) { event.preventDefault(); json_start(this); var channame = $(this).find('span[class="name"]').html(); @@ -220,6 +214,11 @@ $('#channels ul#chan_menu a').tap(function(event) { return false; }); +$('#channels ul#chan_menu .toggleLink').tap(function(event) { + event.preventDefault(); + $('#channels ul#chan_menu li[rel="toggle"]').show(); + $('#channels ul#chan_menu li[rel="showbut"]').remove(); +}); //Gen Categories function gen_categories() { $("#cat_menu").html(''); @@ -244,9 +243,15 @@ function gen_channels(category) { dataString, function(data){ $.each(data.channel,function(i,channel){ - $("#chan_menu").append('
  • ' + channel.number + '' + channel.name + '' + channel.now_title + '
  • '); - + if ( i <= 10 ) { + $("#chan_menu").append('
  • ' + channel.number + '' + channel.name + '' + channel.now_title + '
  • '); + } + else { + $("#chan_menu").append('
  • ' + channel.number + '' + channel.name + '' + channel.now_title + '
  • '); + } }); + $('li[rel="toggle"]').hide(); + $("#chan_menu").append('
  • Show all
  • '); json_complete('#channels','cube'); }) } -- cgit v1.2.3