From 2e6b9452fe8333793f29c76d71dbd0705627d3f1 Mon Sep 17 00:00:00 2001 From: Saqib Razzaq Date: Wed, 6 Apr 2016 15:06:13 +0500 Subject: [PATCH] Fixed: Home Page featured videos Load more button shows if no more videos are featured exists on landing --- upload/includes/functions_helper.php | 3 +++ upload/styles/cb_28/theme/js/custom.js | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/upload/includes/functions_helper.php b/upload/includes/functions_helper.php index 96e93888..8e8b7e91 100644 --- a/upload/includes/functions_helper.php +++ b/upload/includes/functions_helper.php @@ -168,6 +168,9 @@ case 'photos': $type = 'photo'; break; + case 'channels': + $type = 'channels'; + break; default: $type = 'video'; diff --git a/upload/styles/cb_28/theme/js/custom.js b/upload/styles/cb_28/theme/js/custom.js index a7146bdc..4c703cfc 100644 --- a/upload/styles/cb_28/theme/js/custom.js +++ b/upload/styles/cb_28/theme/js/custom.js @@ -203,8 +203,21 @@ function homePageVideos(qlist_items) { success: function(data) { $(main_object).text("Load More"); - if (data === '') { + if (data.length < 10) { $(main_object).remove(); + if (loadHit == 1) { + if (loadMode = 'featured') { + $('#featured_load_more').hide(); + $('#featured_pre').hide(); + $("#featured_vid_sec").html('
No featured videos found'); + return false; + } else if (loadMode == 'recent') { + $('#recent_load_more').remove(); + $('#recent_pre').remove(); + $("#recent_vids_sec").html('
No recent videos found'); + return false; + } + } return true; } if (loadType == 'video') {