From 4fa98d938a7e7eed3db0d0b96e1ed7bf60afc92c Mon Sep 17 00:00:00 2001 From: Jano Slota Date: Sat, 26 Jul 2014 21:57:48 +0200 Subject: [PATCH] Fix save-user_flag.js Conflicts: js/save-user_flag.js --- js/save-user_flag.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/save-user_flag.js b/js/save-user_flag.js index 120dfa08..d588a424 100644 --- a/js/save-user_flag.js +++ b/js/save-user_flag.js @@ -1,8 +1,14 @@ -onready(function(){ - var flagStorage = "flag_"+window.location.pathname.split('/')[1]; +function user_flag() { + var flagStorage = "flag_" + document.getElementsByName('board')[0].value; var item = window.localStorage.getItem(flagStorage); $('select[name=user_flag]').val(item); $('select[name=user_flag]').change(function() { window.localStorage.setItem(flagStorage, $(this).val()); }); -}); \ No newline at end of file + $(window).on('quick-reply', function() { + $('form#quick-reply select[name="user_flag"]').val($('select[name="user_flag"]').val()); + }); +} +if (active_page == 'thread' || active_page == 'index') { + $(document).ready(user_flag); +}