save filter visibility after reloading page #921

This commit is contained in:
Alexander Machehin 2013-02-21 16:05:57 +06:00
parent 1c4ec45639
commit 2c2397c1d7
1 changed files with 8 additions and 0 deletions

View File

@ -73,16 +73,24 @@
.switch
%a{:href => "#"}= t 'layout.hide'
:javascript
var MONITORING_FILTER_HIDE = "monitoring_filter_hide";
$(".switch").toggle(
function () {
var d = new Date();
d.setMonth(d.getMonth() + 1);
$(".filter").hide("slow");
$(".switch a").text("#{t 'layout.show'}");
setCookie(MONITORING_FILTER_HIDE, 'true', d);
},
function () {
$(".filter").show("slow");
$(".switch a").text("#{t 'layout.hide'}");
var d = new Date();
d.setMonth(d.getMonth() + 1);
setCookie(MONITORING_FILTER_HIDE, 'false', d);
}
);
#{cookies[:monitoring_filter_hide] == 'true' ? "$('.switch').click();" : ''}
#{if I18n.locale == :ru
"$.datepicker.regional['ru'] = {
closeText: 'Закрыть',