From 6f66d2fd5de98b7bbad06cbb012032d9daf86103 Mon Sep 17 00:00:00 2001 From: Jess Lin Date: Mon, 20 Apr 2015 22:04:18 -0700 Subject: [PATCH] [Gutter] Convert GutterContainerComponent::updateChildGutters -> ::reorderGutters --- src/gutter-container-component.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gutter-container-component.coffee b/src/gutter-container-component.coffee index 87747acea..04d0920d6 100644 --- a/src/gutter-container-component.coffee +++ b/src/gutter-container-component.coffee @@ -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.