mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
32 lines
657 B
CoffeeScript
32 lines
657 B
CoffeeScript
Q = require 'q'
|
|
Package = require './package'
|
|
|
|
module.exports =
|
|
class ThemePackage extends Package
|
|
getType: -> 'theme'
|
|
|
|
getStyleSheetPriority: -> 1
|
|
|
|
enable: ->
|
|
atom.config.unshiftAtKeyPath('core.themes', @name)
|
|
|
|
disable: ->
|
|
atom.config.removeAtKeyPath('core.themes', @name)
|
|
|
|
load: ->
|
|
@loadTime = 0
|
|
this
|
|
|
|
activate: ->
|
|
return @activationDeferred.promise if @activationDeferred?
|
|
|
|
@activationDeferred = Q.defer()
|
|
@measure 'activateTime', =>
|
|
try
|
|
@loadStylesheets()
|
|
@activateNow()
|
|
catch error
|
|
@handleError("Failed to activate the #{@name} theme", error)
|
|
|
|
@activationDeferred.promise
|