From bf7e586e6aa194711be9cd499ae199c66ffa957b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 22 Mar 2013 19:15:19 -0600 Subject: [PATCH] Don't apply stylesheets until `active` is called for atom packages --- src/app/atom-package.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/atom-package.coffee b/src/app/atom-package.coffee index 1e9639522..1ceeb62f0 100644 --- a/src/app/atom-package.coffee +++ b/src/app/atom-package.coffee @@ -9,6 +9,7 @@ module.exports = class AtomPackage extends Package metadata: null keymaps: null + stylesheets: null mainModule: null deferActivation: false @@ -46,9 +47,10 @@ class AtomPackage extends Package @keymaps.push(CSON.readObject(path)) loadStylesheets: -> + @stylesheets = [] stylesheetDirPath = fs.join(@path, 'stylesheets') for stylesheetPath in fs.list(stylesheetDirPath, ['css', 'less']) ? [] - requireStylesheet(stylesheetPath) + @stylesheets.push([stylesheetPath, loadStylesheet(stylesheetPath)]) loadGrammars: -> grammarsDirPath = fs.join(@path, 'grammars') @@ -65,6 +67,7 @@ class AtomPackage extends Package activate: -> keymap.add(map) for map in @keymaps + applyStylesheet(path, content) for [path, content] in @stylesheets if @deferActivation @subscribeToActivationEvents()