From 5dfe3b8c21ca79300a1851d7658f8aa389b2733f Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sat, 26 Jan 2013 03:31:05 -0600 Subject: BUGFIX: Clicking the 'mute' button doesn't save across all maps until page is refreshed --- js/mapspecs.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/mapspecs.js b/js/mapspecs.js index b9d0aa4..5c4141d 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -830,10 +830,29 @@ function rgbStringToHex(rgbString) { return hexString ='#'+parts.join('').toUpperCase(); // "#0070FF" } +var ignoreMuteChecks = false; +function setMute(value) +{ + if(!ignoreMuteChecks) + { + //Prevent changes to other checkboxes from calling this function: + ignoreMuteChecks = true; + + //Set all other checkboxes + var muteButtons = document.getElementsByClassName("checkbox_mute"); + for(var i=0; i < muteButtons.length; i++) + { + muteButtons[i].checked = value; + } + savePref('mute', value); + + ignoreMuteChecks = false; + } +} function savePref(pref, value) { - setCookie('pref_'+pref, value,31); + setCookie('pref_'+pref, value, 9999); } //Cookie functions from w3schools.com -- cgit v1.2.3