Skip to content

Commit

Permalink
🐛 Set the with-minimap attribute in attached callback
Browse files Browse the repository at this point in the history
Fixes #487
  • Loading branch information
abe33 committed May 25, 2016
1 parent 80fd653 commit 478e5ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/minimap-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ export default class MinimapElement {
this.attached = true
this.attachedToTextEditor = this.parentNode === this.getTextEditorElementRoot()

if (this.attachedToTextEditor) {
this.getTextEditorElement().setAttribute('with-minimap', '')
}

/*
We use `atom.styles.onDidAddStyleElement` instead of
`atom.themes.onDidChangeActiveThemes`.
Expand Down Expand Up @@ -376,10 +380,6 @@ export default class MinimapElement {
attach (parent) {
if (this.attached) { return }
(parent || this.getTextEditorElementRoot()).appendChild(this)

if (!parent) {
this.getTextEditorElement().setAttribute('with-minimap', '')
}
}

/**
Expand Down

0 comments on commit 478e5ef

Please sign in to comment.