diff --git a/lib/minimap-element.coffee b/lib/minimap-element.coffee index ed6349ef..a5dc2f25 100644 --- a/lib/minimap-element.coffee +++ b/lib/minimap-element.coffee @@ -40,15 +40,6 @@ class MinimapElement extends HTMLElement @subscriptions = new CompositeDisposable @initializeContent() - # Uses of `atom.styles.onDidAddStyleElement` instead of - # `atom.themes.onDidChangeActiveThemes`. - # Why? - # Currently, The styleElement will be removed first, - # and then re-add. So the `change` event has not be triggered. - @subscriptions.add atom.styles.onDidAddStyleElement => - @invalidateCache() - @requestForcedUpdate() - @observeConfig 'minimap.displayMinimapOnLeft': (displayMinimapOnLeft) => swapPosition = @minimap? and displayMinimapOnLeft isnt @displayMinimapOnLeft @@ -89,6 +80,15 @@ class MinimapElement extends HTMLElement @measureHeightAndWidth() @attached = true + # Uses of `atom.styles.onDidAddStyleElement` instead of + # `atom.themes.onDidChangeActiveThemes`. + # Why? + # Currently, The styleElement will be removed first, + # and then re-add. So the `change` event has not be triggered. + @subscriptions.add atom.styles.onDidAddStyleElement => + @invalidateCache() + @requestForcedUpdate() + # Internal: DOM callback invoked when a new {MinimapElement} is detached # from the DOM. detachedCallback: ->