1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Fix save-user_flag.js

Conflicts:
	js/save-user_flag.js
This commit is contained in:
Jano Slota 2014-07-26 21:57:48 +02:00 committed by czaks
parent 9a98d518a0
commit 4fa98d938a

View File

@ -1,8 +1,14 @@
onready(function(){ function user_flag() {
var flagStorage = "flag_"+window.location.pathname.split('/')[1]; var flagStorage = "flag_" + document.getElementsByName('board')[0].value;
var item = window.localStorage.getItem(flagStorage); var item = window.localStorage.getItem(flagStorage);
$('select[name=user_flag]').val(item); $('select[name=user_flag]').val(item);
$('select[name=user_flag]').change(function() { $('select[name=user_flag]').change(function() {
window.localStorage.setItem(flagStorage, $(this).val()); window.localStorage.setItem(flagStorage, $(this).val());
}); });
$(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);
}