More button + block added for featured videos
This commit is contained in:
parent
2495fd12d7
commit
c0f5a9a50d
2 changed files with 33 additions and 9 deletions
|
@ -74,6 +74,21 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
{if $display_type=='featuredHome'}
|
||||
<div class="item-video col-lg-6 col-md-6 col-sm-6 col-xs-12">
|
||||
<div class="clearfix thumb-holder">
|
||||
<a class="video-link" href="{videoLink($video)}" title="{$video.title|title}">
|
||||
<img class="img-responsive" src="{getThumb vdetails=$video size=600x338 }">
|
||||
<h2 class="title">{$video.title|truncate:50}</h2>
|
||||
<span class="duration">{if $video.duration>1}{$video.duration|SetTime}{else}00:00{/if}</span>
|
||||
</a>
|
||||
{ANCHOR place='in_video_thumb' data=$video}
|
||||
<img data-quick="quick-{$video.videoid}"
|
||||
class="icon-add add_icon cb_quickie cb-btn-quick-{$video.videoid}" onclick="add_quicklist(this,'{$video.videoid}')" src="{$imageurl}/dot.gif" title="Add {$video.title} to Quicklist">
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $display_type=='normal' || $display_type==''}
|
||||
<div class="item_video col-lg-12 col-md-12 col-sm-6 clearfix">
|
||||
<div class="row clearfix">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
{$limit = '2'}
|
||||
{$featured=$cbvid->get_videos(["featured"=>"yes","limit"=>$limit])}
|
||||
{if $featured}
|
||||
<section class="clearfix featured-videos">
|
||||
<section id="featured_vid_sec" class="clearfix featured-videos">
|
||||
<h1>{lang code="Featured Videos"}</h1>
|
||||
<div class="clearfix row">
|
||||
{foreach from=$featured item=video}
|
||||
|
@ -50,6 +50,7 @@
|
|||
{include file="$style_dir/blocks/videos/video.html" display_type='featuredVideos'}
|
||||
</div>
|
||||
{/foreach}
|
||||
<button id="home_load_more" class="btn btn-primary col-md-12 col-sm-12" loadtype="video" loadmode="featured" loadlimit="2" loadhit="1">Load More</button>
|
||||
</div>
|
||||
</section>
|
||||
{else}
|
||||
|
@ -143,10 +144,7 @@
|
|||
loadMode = $(main_object).attr('loadmode'),
|
||||
loadLimit = $(main_object).attr('loadlimit'),
|
||||
loadHit = $(main_object).attr('loadhit'),
|
||||
newloadHit = parseInt(loadHit) + 1
|
||||
;
|
||||
alert(loadHit);
|
||||
alert(newloadHit);
|
||||
newloadHit = parseInt(loadHit) + 1;
|
||||
$.ajax({
|
||||
url: loadLink,
|
||||
type: sendType,
|
||||
|
@ -165,13 +163,24 @@
|
|||
|
||||
success: function(data) {
|
||||
$('#home_load_more').remove();
|
||||
//$(main_object).attr('loadhit',load_hit);
|
||||
if (data === '') {
|
||||
if (loadMode == 'recent') {
|
||||
$('#recent_vids_sec').append('<button id="home_load_more" class="btn btn-primary col-md-12 col-sm-12" disabled="disabled">You have reached end of list</button>');
|
||||
} else {
|
||||
$('#featured_vid_sec').append('<button id="home_load_more" class="btn btn-primary col-md-12 col-sm-12" disabled="disabled">You have reached end of list</button>');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
$(main_object).text("Load More");
|
||||
if (loadType == 'video') {
|
||||
if (loadMode == 'recent') {
|
||||
$('#recent_vids_sec').append(data);
|
||||
}
|
||||
|
||||
$('#recent_vids_sec').append('<button id="home_load_more" class="btn btn-primary col-md-12 col-sm-12" loadtype="video" loadmode="recent" loadlimit="8" loadhit="'+newloadHit+'">Load More</button>');
|
||||
} else {
|
||||
$('#featured_vid_sec').append(data);
|
||||
$('#featured_vid_sec').append('<button id="home_load_more" class="btn btn-primary col-md-12 col-sm-12" loadtype="video" loadmode="featured" loadlimit="2" loadhit="'+newloadHit+'">Load More</button>');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue