sidebar filter fixes

remotes/origin/stage5
ya_dim4ik 10 years ago
parent cd2a003ffb
commit c0731181ba
  1. 18
      static/client/css/main.css
  2. 2
      static/client/css_min/main.min.css
  3. 35
      static/client/js/scripts.js
  4. 35
      static/client/js/vendor.js
  5. 16
      static/client/js_min/vendor.min.js
  6. BIN
      static/img/white-ajax-loader.gif
  7. 2
      templates/client/includes/events/filter_form.html

@ -13169,6 +13169,24 @@ label[for="id_date_to"],
display: none; display: none;
} }
#filter_form_wraper{
position: relative;
}
.filters_overlay{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(255,255,255,.7);
display: none;
}
.none{
display: none;
}

File diff suppressed because one or more lines are too long

@ -29,6 +29,33 @@ function set_filter_block_height () {
}); });
} }
function build_sidebar() {
var results_count = $('cl-item ').length,
$aside_block = $('aside .mps-sect'),
$aside_news = $('aside .s-news-list'),
$aside_sbnr = $('aside .sbnr'),
$aside_vk = $('aside .vk-widget'),
$aside_subscribe = $('aside .subscribe-sm'),
$aside_hr = $('aside hr');
if (results_count <= 5){
$aside_block.addClass('none');
$aside_news.addClass('none');
$aside_sbnr.addClass('none');
$aside_vk.addClass('none');
$aside_subscribe.addClass('none');
$aside_hr.addClass('none');
} else {
$aside_block.removeClass('none');
$aside_news.removeClass('none');
$aside_sbnr.removeClass('none');
$aside_vk.removeClass('none');
$aside_subscribe.removeClass('none');
$aside_hr.removeClass('none');
}
}
function build_filters_period () { function build_filters_period () {
// работа с ссылкой "уточнить дату в боковом фильтре" // работа с ссылкой "уточнить дату в боковом фильтре"
var $period_link = $('#filter_period_trigger'), var $period_link = $('#filter_period_trigger'),
@ -37,7 +64,7 @@ function build_filters_period () {
$period_link.insertAfter('#id_date_to').wrap($('<div></div>', {class: 'period_block'})); $period_link.insertAfter('#id_date_to').wrap($('<div></div>', {class: 'period_block'}));
if ($filters.find('#dateFrom').val() || $filters.find('#dateTo').val()){ if ($filters.find('input#id_date_from').val() || $filters.find('input#id_date_to').val()){
$month_block.hide(); $month_block.hide();
} }
@ -67,6 +94,7 @@ function submit_search_form () {
$loader.show(); $loader.show();
$('.filters_overlay').show();
$('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500); $('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500);
@ -74,6 +102,7 @@ function submit_search_form () {
if (data.success) { if (data.success) {
$('.page-body').html(data.results); $('.page-body').html(data.results);
build_sidebar();
$loader.hide(); $loader.hide();
} }
}); });
@ -118,7 +147,7 @@ $(document).ready(function () {
var search_string = '', var search_string = '',
$link = $(this); $link = $(this);
$link.html('<img src="/static/client/img/wait.gif">'); $link.html('<img src="/static/img/white-ajax-loader.gif">');
$.each(window.sendData, function(i, val) { $.each(window.sendData, function(i, val) {
var key = i; var key = i;
@ -208,7 +237,7 @@ $(document).ready(function () {
$('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) { $('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) {
event.preventDefault(); event.preventDefault();
$('.filter_form input').prop('checked', false); window.location.reload();
}); });

@ -4946,6 +4946,33 @@ function set_filter_block_height () {
}); });
} }
function build_sidebar() {
var results_count = $('cl-item ').length,
$aside_block = $('aside .mps-sect'),
$aside_news = $('aside .s-news-list'),
$aside_sbnr = $('aside .sbnr'),
$aside_vk = $('aside .vk-widget'),
$aside_subscribe = $('aside .subscribe-sm'),
$aside_hr = $('aside hr');
if (results_count <= 5){
$aside_block.addClass('none');
$aside_news.addClass('none');
$aside_sbnr.addClass('none');
$aside_vk.addClass('none');
$aside_subscribe.addClass('none');
$aside_hr.addClass('none');
} else {
$aside_block.removeClass('none');
$aside_news.removeClass('none');
$aside_sbnr.removeClass('none');
$aside_vk.removeClass('none');
$aside_subscribe.removeClass('none');
$aside_hr.removeClass('none');
}
}
function build_filters_period () { function build_filters_period () {
// работа с ссылкой "уточнить дату в боковом фильтре" // работа с ссылкой "уточнить дату в боковом фильтре"
var $period_link = $('#filter_period_trigger'), var $period_link = $('#filter_period_trigger'),
@ -4954,7 +4981,7 @@ function build_filters_period () {
$period_link.insertAfter('#id_date_to').wrap($('<div></div>', {class: 'period_block'})); $period_link.insertAfter('#id_date_to').wrap($('<div></div>', {class: 'period_block'}));
if ($filters.find('#dateFrom').val() || $filters.find('#dateTo').val()){ if ($filters.find('input#id_date_from').val() || $filters.find('input#id_date_to').val()){
$month_block.hide(); $month_block.hide();
} }
@ -4984,6 +5011,7 @@ function submit_search_form () {
$loader.show(); $loader.show();
$('.filters_overlay').show();
$('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500); $('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500);
@ -4991,6 +5019,7 @@ function submit_search_form () {
if (data.success) { if (data.success) {
$('.page-body').html(data.results); $('.page-body').html(data.results);
build_sidebar();
$loader.hide(); $loader.hide();
} }
}); });
@ -5035,7 +5064,7 @@ $(document).ready(function () {
var search_string = '', var search_string = '',
$link = $(this); $link = $(this);
$link.html('<img src="/static/client/img/wait.gif">'); $link.html('<img src="/static/img/white-ajax-loader.gif">');
$.each(window.sendData, function(i, val) { $.each(window.sendData, function(i, val) {
var key = i; var key = i;
@ -5125,7 +5154,7 @@ $(document).ready(function () {
$('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) { $('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) {
event.preventDefault(); event.preventDefault();
$('.filter_form input').prop('checked', false); window.location.reload();
}); });

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

@ -34,4 +34,6 @@
</div> </div>
{% include 'client/popups/filter_period.html' %} {% include 'client/popups/filter_period.html' %}
<div class="filters_overlay"></div>
</form> </form>

Loading…
Cancel
Save