summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-26 03:31:05 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-26 03:31:05 -0600
commit5dfe3b8c21ca79300a1851d7658f8aa389b2733f (patch)
treecec57fbb05666de1fecefe23de00e9d54ac1e50c /js
parentd7b0c04459a6ec42a37255c38d67cea14fb60e61 (diff)
downloadpathery-5dfe3b8c21ca79300a1851d7658f8aa389b2733f.tar.xz
BUGFIX: Clicking the 'mute' button doesn't save across all maps until page is refreshed
Diffstat (limited to 'js')
-rw-r--r--js/mapspecs.js21
1 files changed, 20 insertions, 1 deletions
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