mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
29 lines
653 B
CoffeeScript
29 lines
653 B
CoffeeScript
Package = require './package'
|
|
|
|
module.exports =
|
|
class ThemePackage extends Package
|
|
getType: -> 'theme'
|
|
|
|
getStyleSheetPriority: -> 1
|
|
|
|
enable: ->
|
|
@config.unshiftAtKeyPath('core.themes', @name)
|
|
|
|
disable: ->
|
|
@config.removeAtKeyPath('core.themes', @name)
|
|
|
|
load: ->
|
|
@loadTime = 0
|
|
this
|
|
|
|
activate: ->
|
|
@activationPromise ?= new Promise (resolve, reject) =>
|
|
@resolveActivationPromise = resolve
|
|
@rejectActivationPromise = reject
|
|
@measure 'activateTime', =>
|
|
try
|
|
@loadStylesheets()
|
|
@activateNow()
|
|
catch error
|
|
@handleError("Failed to activate the #{@name} theme", error)
|