Skip to content

Commit

Permalink
🐛 Fix missing DOM cache invalidation when themes are changed
Browse files Browse the repository at this point in the history
Fixes #250
  • Loading branch information
abe33 committed Feb 4, 2015
1 parent 389f387 commit 333c155
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/minimap-element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MinimapElement extends HTMLElement
@initializeContent()

@subscriptions.add atom.themes.onDidChangeActiveThemes =>
@invalidateCache()
@requestForcedUpdate()

@observeConfig
Expand Down
16 changes: 15 additions & 1 deletion spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,20 @@ describe 'MinimapElement', ->
# ## ## ## ## ## ### ## ## ## ##
# ###### ####### ## ## ## #### ######

describe 'when the atom them is changed', ->
beforeEach ->
nextAnimationFrame()
spyOn(minimapElement, 'requestForcedUpdate').andCallThrough()
spyOn(minimapElement, 'invalidateCache').andCallThrough()

atom.themes.emitter.emit 'did-change-active-themes'

waitsFor -> minimapElement.frameRequested

it 'forces a refresh with cache invalidation', ->
expect(minimapElement.requestForcedUpdate).toHaveBeenCalled()
expect(minimapElement.invalidateCache).toHaveBeenCalled()

describe 'when minimap.textOpacity is changed', ->
beforeEach ->
spyOn(minimapElement, 'requestForcedUpdate').andCallThrough()
Expand Down Expand Up @@ -519,7 +533,7 @@ describe 'MinimapElement', ->
nextAnimationFrame()

atom.config.set 'minimap.minimapScrollIndicator', true

waitsFor -> minimapElement.frameRequested
runs -> nextAnimationFrame()

Expand Down

0 comments on commit 333c155

Please sign in to comment.