mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
[Gutter] Convert GutterContainerComponent::updateChildGutters -> ::reorderGutters
This commit is contained in:
parent
3051470979
commit
6f66d2fd5d
@ -38,10 +38,11 @@ class GutterContainerComponent
|
||||
else
|
||||
gutterComponent = new CustomGutterComponent({gutter})
|
||||
if visible then gutterComponent.showNode() else gutterComponent.hideNode()
|
||||
gutterComponent.updateSync(state)
|
||||
newGutterComponents.push(gutterComponent)
|
||||
newGutterComponentsByGutterName[gutter.name] = gutterComponent
|
||||
|
||||
@updateChildGutters(state, newGutterComponents, newGutterComponentsByGutterName)
|
||||
@reorderGutters(newGutterComponents, newGutterComponentsByGutterName)
|
||||
|
||||
@gutterComponents = newGutterComponents
|
||||
@gutterComponentsByGutterName = newGutterComponentsByGutterName
|
||||
@ -50,12 +51,12 @@ class GutterContainerComponent
|
||||
Section: Private Methods
|
||||
###
|
||||
|
||||
updateChildGutters: (state, newGutterComponents, newGutterComponentsByGutterName) ->
|
||||
reorderGutters: (newGutterComponents, newGutterComponentsByGutterName) ->
|
||||
# First, insert new gutters into the DOM.
|
||||
indexInOldGutters = 0
|
||||
oldGuttersLength = @gutterComponents.length
|
||||
|
||||
for gutterComponent in newGutterComponents
|
||||
gutterComponent.updateSync(state)
|
||||
if @gutterComponentsByGutterName[gutterComponent.getName()]
|
||||
# If the gutter existed previously, we first try to move the cursor to
|
||||
# the point at which it occurs in the previous gutters.
|
||||
|
Loading…
Reference in New Issue
Block a user