From 549ce0077e859aec441dead0f076f2a1dd89ddcd Mon Sep 17 00:00:00 2001 From: Menci Date: Thu, 20 Apr 2017 21:41:22 +0800 Subject: [PATCH] Fix problems tag show is hidden, hidden is show --- views/problems.ejs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/views/problems.ejs b/views/problems.ejs index 2443f9f..0e75891 100644 --- a/views/problems.ejs +++ b/views/problems.ejs @@ -4,7 +4,6 @@ let tagIDs = []; if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); %> -
@@ -38,12 +37,12 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id);
@@ -51,11 +50,11 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); $(function () { $('#show_tag').checkbox('setting', 'onChange', function () { let checked = $('#show_tag').checkbox('is checked'); - Cookies.set('show_tag', checked ? '1' : '0'); + localStorage.setItem('show_tag', checked ? '1' : '0'); if (checked) { - document.getElementById('show_tag_style').innerHTML = '.show_tag_controled { width: 0; white-space: nowrap; overflow: hidden; }'; - } else { document.getElementById('show_tag_style').innerHTML = '.show_tag_controled { white-space: nowrap; overflow: hidden; }'; + } else { + document.getElementById('show_tag_style').innerHTML = '.show_tag_controled { width: 0; white-space: nowrap; overflow: hidden; }'; } }); });