From 478e5ef75b6652329f7696ffffb03b56d6ac4066 Mon Sep 17 00:00:00 2001 From: abe33 Date: Wed, 25 May 2016 10:27:16 +0200 Subject: [PATCH] :bug: Set the with-minimap attribute in attached callback Fixes #487 --- lib/minimap-element.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/minimap-element.js b/lib/minimap-element.js index 01358d0a..80feb23a 100644 --- a/lib/minimap-element.js +++ b/lib/minimap-element.js @@ -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`. @@ -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', '') - } } /**