mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Clean up theme check in PackageManager with PackageActivators
You can now call `PackageManager.registerPackageActivator` for specific package types. On `PackageManager.activate` it will call your `PackageActivator.activatePackages(packages)` with the proper packages.
This commit is contained in:
@@ -17,6 +17,7 @@ class ThemeManager
|
||||
|
||||
constructor: (@packageManager) ->
|
||||
@lessCache = null
|
||||
@packageManager.registerPackageActivator(this, ['theme'])
|
||||
|
||||
# Internal-only:
|
||||
getAvailableNames: ->
|
||||
@@ -38,6 +39,9 @@ class ThemeManager
|
||||
getLoadedThemes: ->
|
||||
pack for pack in @packageManager.getLoadedPackages() when pack.isTheme()
|
||||
|
||||
# Internal-only: adhere to the PackageActivator interface
|
||||
activatePackages: (themePackages) -> @activateThemes()
|
||||
|
||||
# Internal-only:
|
||||
activateThemes: ->
|
||||
# atom.config.observe runs the callback once, then on subsequent changes.
|
||||
|
||||
Reference in New Issue
Block a user