@@ -5,7 +5,6 @@ import { EventsDelegation, AncestorsMethods } from 'atom-utils-plus'
55import elementResizeDetectorImport from 'element-resize-detector'
66
77import * as Main from './main'
8- import DOMStylesReader from './dom-styles-reader'
98import CanvasDrawer from './mixins/canvas-drawer'
109import include from './decorators/include'
1110import element from './decorators/element'
@@ -83,10 +82,7 @@ class MinimapElement {
8382 * @access private
8483 */
8584 this . minimap = undefined
86- /**
87- * @access private
88- */
89- this . editorElement = undefined
85+
9086 /**
9187 * @access private
9288 */
@@ -181,11 +177,6 @@ class MinimapElement {
181177 */
182178 this . quickSettingsElement = undefined
183179
184- /**
185- * This MinimapElement's DOMStylesReader
186- */
187- this . DOMStylesReader = new DOMStylesReader ( )
188-
189180 // States
190181
191182 /**
@@ -379,10 +370,10 @@ class MinimapElement {
379370 this . measureHeightAndWidth ( )
380371 this . updateMinimapFlexPosition ( )
381372 this . attached = true
382- this . attachedToTextEditor = this . queryParentSelector ( 'atom-text-editor' ) === this . getTextEditorElement ( )
373+ this . attachedToTextEditor = this . queryParentSelector ( 'atom-text-editor' ) === this . minimap . getTextEditorElement ( )
383374
384375 if ( this . attachedToTextEditor ) {
385- this . getTextEditorElement ( ) . setAttribute ( 'with-minimap' , '' )
376+ this . minimap . getTextEditorElement ( ) . setAttribute ( 'with-minimap' , '' )
386377 }
387378
388379 this . subscriptions . add (
@@ -408,7 +399,7 @@ class MinimapElement {
408399 * @access private
409400 */
410401 detachedCallback ( ) {
411- this . getTextEditorElement ( ) . removeAttribute ( 'with-minimap' )
402+ this . minimap . getTextEditorElement ( ) . removeAttribute ( 'with-minimap' )
412403 this . attached = false
413404 }
414405
@@ -442,7 +433,7 @@ class MinimapElement {
442433 attach ( parent ) {
443434 if ( this . attached ) { return }
444435
445- const container = parent || this . getTextEditorElement ( )
436+ const container = parent || this . minimap . getTextEditorElement ( )
446437 const minimaps = container . querySelectorAll ( 'atom-text-editor-minimap' )
447438 if ( minimaps . length ) {
448439 Array . prototype . forEach . call ( minimaps , ( el ) => { el . destroy ( ) } )
@@ -666,25 +657,6 @@ class MinimapElement {
666657 delete this . openQuickSettings
667658 }
668659
669- /**
670- * Returns the target `TextEditor` of the Minimap.
671- *
672- * @return {TextEditor } the minimap's text editor
673- */
674- getTextEditor ( ) { return this . minimap . getTextEditor ( ) }
675-
676- /**
677- * Returns the `TextEditorElement` for the Minimap's `TextEditor`.
678- *
679- * @return {TextEditorElement } the minimap's text editor element
680- */
681- getTextEditorElement ( ) {
682- if ( this . editorElement ) { return this . editorElement }
683-
684- this . editorElement = atom . views . getView ( this . getTextEditor ( ) )
685- return this . editorElement
686- }
687-
688660 // ## ## ####### ######## ######## ##
689661 // ### ### ## ## ## ## ## ##
690662 // #### #### ## ## ## ## ## ##
@@ -1088,7 +1060,7 @@ class MinimapElement {
10881060 const row = Math . floor ( deltaY / this . minimap . getLineHeight ( ) ) + this . minimap . getFirstVisibleScreenRow ( )
10891061
10901062 const textEditor = this . minimap . getTextEditor ( )
1091- const textEditorElement = this . getTextEditorElement ( )
1063+ const textEditorElement = this . minimap . getTextEditorElement ( )
10921064
10931065 const scrollTop = row * textEditor . getLineHeightInPixels ( ) - this . minimap . getTextEditorHeight ( ) / 2
10941066 const textEditorScrollTop = textEditorElement . pixelPositionForScreenPosition ( [ row , 0 ] ) . top - this . minimap . getTextEditorHeight ( ) / 2
0 commit comments