mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Update enabled themes list when config key is updated
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
b110f430ee
commit
ad0bcc3851
@@ -36,3 +36,8 @@ describe "ThemeConfigPanel", ->
|
||||
panel.enabledThemes.sortable('option', 'receive')(null, helper: dragHelper[0])
|
||||
panel.enabledThemes.sortable('option', 'update')()
|
||||
expect(config.get('core.themes')).toEqual ['atom-dark-ui', 'atom-dark-syntax']
|
||||
|
||||
describe "when the 'core.config' key is updated", ->
|
||||
it "refreshes the enabled themes list", ->
|
||||
config.set('core.themes', ['atom-light-ui', 'atom-light-syntax'])
|
||||
expect(panel.getEnabledThemeNames()).toEqual ['atom-light-ui', 'atom-light-syntax']
|
||||
|
||||
@@ -29,8 +29,10 @@ class ThemeConfigPanel extends ConfigPanel
|
||||
for name in atom.getAvailableThemeNames()
|
||||
@availableThemes.append(@buildThemeLi(name, draggable: true))
|
||||
|
||||
for name in config.get("core.themes") ? []
|
||||
@enabledThemes.append(@buildThemeLi(name))
|
||||
@observeConfig "core.themes", (enabledThemes) =>
|
||||
@enabledThemes.empty()
|
||||
for name in enabledThemes ? []
|
||||
@enabledThemes.append(@buildThemeLi(name))
|
||||
|
||||
@enabledThemes.sortable
|
||||
receive: (e, ui) => @enabledThemeReceived($(ui.helper))
|
||||
|
||||
Reference in New Issue
Block a user