#1458: Правки по ТЗ

parent 1846f66b
...@@ -28,8 +28,7 @@ GeneratorAsset::register($this); ...@@ -28,8 +28,7 @@ GeneratorAsset::register($this);
</div> </div>
<div class="load-box"> <div class="load-box">
<a href="<?=Url::to(['/blog/post/load']);?>" class="sidebar_btn" id="load-post" data-offset="<?=Post::PAGE_SIZE?>" data-tag="<?=$model->id?>" style="display:block; margin: 0 auto;"><?=\Yii::t('blog', 'Load more')?></a> <div data-url="<?=Url::to(['/blog/post/load']);?>" class="sidebar_btn" id="load-post" data-offset="<?=Post::PAGE_SIZE?>" data-tag="<?=$model->id?>" style="display:block; margin: 0 auto;"><?=\Yii::t('blog', 'Load more')?></div> <div class="loading-post"></div>
<div class="loading-post"></div>
</div> </div>
<?php endif; ?> <?php endif; ?>
......
...@@ -117,11 +117,11 @@ function initScrollPager() { ...@@ -117,11 +117,11 @@ function initScrollPager() {
} }
function loadPosts() { function loadPosts() {
var button = $('a#load-post'), loading = $('.loading-post'), offset = button.data('offset'), tag = button.data('tag'); var button = $('#load-post'), loading = $('.loading-post'), offset = button.data('offset'), tag = button.data('tag');
$.ajax({ $.ajax({
method: 'POST', method: 'POST',
url: button.attr('href'), url: button.attr('data-url'),
data: { data: {
offset: offset, offset: offset,
tag: tag tag: tag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment