save filter visibility after reloading page #921
This commit is contained in:
parent
1c4ec45639
commit
2c2397c1d7
|
@ -73,16 +73,24 @@
|
||||||
.switch
|
.switch
|
||||||
%a{:href => "#"}= t 'layout.hide'
|
%a{:href => "#"}= t 'layout.hide'
|
||||||
:javascript
|
:javascript
|
||||||
|
var MONITORING_FILTER_HIDE = "monitoring_filter_hide";
|
||||||
$(".switch").toggle(
|
$(".switch").toggle(
|
||||||
function () {
|
function () {
|
||||||
|
var d = new Date();
|
||||||
|
d.setMonth(d.getMonth() + 1);
|
||||||
$(".filter").hide("slow");
|
$(".filter").hide("slow");
|
||||||
$(".switch a").text("#{t 'layout.show'}");
|
$(".switch a").text("#{t 'layout.show'}");
|
||||||
|
setCookie(MONITORING_FILTER_HIDE, 'true', d);
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
$(".filter").show("slow");
|
$(".filter").show("slow");
|
||||||
$(".switch a").text("#{t 'layout.hide'}");
|
$(".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
|
#{if I18n.locale == :ru
|
||||||
"$.datepicker.regional['ru'] = {
|
"$.datepicker.regional['ru'] = {
|
||||||
closeText: 'Закрыть',
|
closeText: 'Закрыть',
|
||||||
|
|
Loading…
Reference in New Issue