1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 15:54:13 +01:00

Fix styles cleanup issue.

This commit is contained in:
Kris Maglione
2014-02-25 09:19:34 -08:00
parent f0dbb9a314
commit 0a9b503bca

View File

@@ -111,8 +111,10 @@ var Hive = Class("Hive", {
},
cleanup: function cleanup() {
for (let sheet in values(this.sheets))
sheet.enabled = false;
for (let sheet of this.sheets)
util.trapErrors(() => {
sheet.enabled = false;
});
},
__iterator__: function () Iterator(this.sheets),
@@ -137,8 +139,12 @@ var Hive = Class("Hive", {
*/
add: function add(name, filter, css, agent, lazy) {
if (!isArray(filter))
if (isArray(filter))
// Need an array from the same compartment.
filter = Array.slice(filter);
else
filter = filter.split(",");
if (name && name in this.names) {
var sheet = this.names[name];
sheet.agent = agent;