Commit f3e76ec8 authored by Shakarim Sapa's avatar Shakarim Sapa

Merge remote-tracking branch 'origin/master'

parents 93374cfd 050e5442
......@@ -9,7 +9,7 @@ use common\modules\bids\models\Bid;
<div class="hidden">
<div id="article" class="popup popup_2 blog_form">
<div class="txtbtnclose"><?=\Yii::t('blog', 'Close')?></div>
<span class="popup__title"><?=\Yii::t('blog', 'Suggest an article for the blog')?></span>
<?php
......@@ -81,7 +81,7 @@ use common\modules\bids\models\Bid;
<div id="feedback" class="popup popup_2 blog_form_2">
<!-- <div class="txtbtnclose">Закрыть</div> -->
<div class="txtbtnclose"><?=\Yii::t('blog', 'Close')?></div>
<span class="popup__title"><?=\Yii::t('blog', 'Offer a subject')?></span>
<p><strong><?=\Yii::t('blog', "We are ready to share our experience, let us know what a topic you're interested in.")?></strong></p>
<br>
......
......@@ -8,6 +8,7 @@ use common\modules\blog\models\Post;
/* @var $this yii\web\View */
/* @var $model common\modules\blog\models\Post */
$this->registerJs("initScrollPager()", yii\web\View::POS_END);
?>
<div class="blog_container">
......
......@@ -8,6 +8,7 @@ use common\modules\blog\models\Post;
/* @var $this yii\web\View */
/* @var $model common\modules\blog\models\Post */
$this->registerJs("initScrollPager()", yii\web\View::POS_END);
?>
<div class="blog_container">
......
......@@ -6,6 +6,18 @@ use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model common\modules\blog\models\Post */
$this->registerJs("
$('.article_short_txt').find('img').click(function() {
$.magnificPopup.open({
items: {
src: $(this).attr('src')
},
image: {
cursor: 'pointer',
},
type: 'image'
});
});", yii\web\View::POS_END);
?>
......
......@@ -18,5 +18,6 @@ For example: write about CRM" => "Что хочу почитать?
'Load more' => 'Загрузить еще',
'Read more...' => 'Читать...',
'Follow us!' => 'Все секреты в наших соц сетях!',
'Offer a subject and we will publish about it' => 'Предложите свою тему и мы напишем'
'Offer a subject and we will publish about it' => 'Предложите свою тему и мы напишем',
'Close' => 'Закрыть'
];
\ No newline at end of file
......@@ -58,6 +58,7 @@ use common\modules\bids\models\Bid;
<?php ActiveForm::end(); ?>
</div>
<?php echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
<?php //todo ?? ?>
<?php //echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?php //echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</div>
\ No newline at end of file
......@@ -13991,7 +13991,7 @@ a.appl_btn {
text-decoration: underline;
}
.article_short_txt {
overflow-x: auto;
}
.article_short_txt img {
margin: 14px 0 11px;
......
......@@ -310,7 +310,17 @@ $(document).ready(function() {
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
mainClass: 'my-mfp-zoom-in',
callbacks: {
open: function() {
$('.mfp-close').mouseover(function() {
$(this).parent().find('.txtbtnclose').show();
}).mouseout(function() {
$(this).parent().find('.txtbtnclose').hide();
});
}
}
});
$(".toggle-mnu").click(function() {
$(this).toggleClass("on");
......
......@@ -68,41 +68,7 @@ $(document).ready(function() {
return false;
});
$('a#load-post').click(function() {
var button = $(this), loading = $('.loading-post'), offset = button.data('offset'), tag = button.data('tag');
button.hide();
loading.show();
$.ajax({
method: 'POST',
url: $(this).attr('href'),
data: {
offset: offset,
tag: tag
},
success: function(response)
{
$('.loaded').append(response.posts);
button.data('offset', response.offset);
if(response.count <= response.offset)
{
button.hide();
}
else
{
button.show();
}
loading.hide();
}
});
return false;
});
$('a#load-post').click(loadPosts);
$.ajax({
url: "/sessions/default/add"
......@@ -133,8 +99,60 @@ $(document).ready(function() {
}).on('submit', function(e){
return false;
});
});
var loadProcess = false;
var allPostsLoaded = false;
function initScrollPager() {
var maxPosition = $(window).scrollTop();
$(window).scroll(function() {
var position = $(window).scrollTop() + $(window).height();
if(position >= maxPosition && position >= $(document).height() - 300 && !loadProcess && !allPostsLoaded) {
maxPosition = position;
loadPosts();
}
});
}
function loadPosts() {
var button = $('a#load-post'), loading = $('.loading-post'), offset = button.data('offset'), tag = button.data('tag');
$.ajax({
method: 'POST',
url: button.attr('href'),
data: {
offset: offset,
tag: tag
},
success: function(response) {
$('.loaded').append(response.posts);
button.data('offset', response.offset);
if(response.count <= response.offset) {
allPostsLoaded = true;
button.hide();
}
else {
button.show();
}
},
beforeSend: function() {
button.hide();
loading.show();
loadProcess = true;
}
}).done(function() {
loading.hide();
loadProcess = false;
});
return false;
}
if($('#chart-container').length > 0)
{
FusionCharts.ready(function () {
......
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