summaryrefslogtreecommitdiff
path: root/common/modules/styles.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2014-02-25 09:19:34 -0800
committerKris Maglione <maglione.k@gmail.com>2014-02-25 09:19:34 -0800
commit0a9b503bca3708b1cabe2e8cbf4034c5466ad901 (patch)
tree5bcc7560edcbe632d31a10f7926e53552f0f0b76 /common/modules/styles.jsm
parentf0dbb9a3148f975ba5e57405038b18539fa9cce5 (diff)
downloadpentadactyl-0a9b503bca3708b1cabe2e8cbf4034c5466ad901.tar.gz
Fix styles cleanup issue.
Diffstat (limited to 'common/modules/styles.jsm')
-rw-r--r--common/modules/styles.jsm12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm
index d4ce815f..5c1ee972 100644
--- a/common/modules/styles.jsm
+++ b/common/modules/styles.jsm
@@ -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;