1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 13:47:59 +01:00

Don't share specially parsed option values across windows.

This commit is contained in:
Kris Maglione
2014-02-17 14:06:07 -08:00
parent e99481a7e3
commit 93665ed5ed
2 changed files with 9 additions and 2 deletions

View File

@@ -628,7 +628,8 @@ var Modes = Module("modes", {
validator: function validator(vals) vals.map(v => v.replace(/^!/, ""))
.every(k => hasOwnProperty(this.values, k)),
get values() array.toObject([[m.name.toLowerCase(), m.description] for (m in values(modes._modes)) if (!m.hidden)])
get values() array.toObject([[m.name.toLowerCase(), m.description]
for (m in values(modes._modes)) if (!m.hidden)])
};
options.add(["passunknown", "pu"],

View File

@@ -95,7 +95,9 @@ var Option = Class("Option", {
return this.globalValue = this.defaultValue;
},
set globalValue(val) {
options.store.set(this.name, { value: val, time: Date.now() });
options.store.set(this.name,
{ value: this.parse(this.stringify(val)),
time: Date.now() });
},
/**
@@ -140,6 +142,9 @@ var Option = Class("Option", {
if ((scope & Option.SCOPE_GLOBAL) && (values == undefined))
values = this.globalValue;
if (hasOwnProperty(this, "_value"))
values = this._value;
if (this.getter)
return util.trapErrors(this.getter, this, values);
@@ -169,6 +174,7 @@ var Option = Class("Option", {
*/
if ((scope & Option.SCOPE_GLOBAL) && !skipGlobal)
this.globalValue = newValues;
this._value = newValues;
this.hasChanged = true;
this.setFrom = null;