mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Get core specs passing w/ Telepath v0.14.0. Delete replication specs.
Telepath v0.14.0 is a ground-up rewrite of the replication library, which is principally designed to support moving document fragments within the overall document. But it's also a lot better in a number of ways. This commit does the minimal to get things working on the new telepath. Standard package specs don't pass yet. Also, I deleted the replication specs since they are extremely convoluted and will be able to be replaced with much better versions once I complete the changes enabled by the new Telepath.
This commit is contained in:
@@ -17,16 +17,17 @@ class PaneAxis extends View
|
||||
@state = site.createDocument(deserializer: @className(), children: [])
|
||||
@addChild(child) for child in args
|
||||
|
||||
@state.get('children').on 'changed', ({index, inserted, removed, site}) =>
|
||||
return if site is @state.site.id
|
||||
for childState in removed
|
||||
@state.get('children').on 'changed', ({index, insertedValues, removedValues, siteId}) =>
|
||||
return if siteId is @state.siteId
|
||||
for childState in removedValues
|
||||
@removeChild(@children(":eq(#{index})").view(), updateState: false)
|
||||
for childState, i in inserted
|
||||
for childState, i in insertedValues
|
||||
@addChild(deserialize(childState), index + i, updateState: false)
|
||||
|
||||
addChild: (child, index=@children().length, options={}) ->
|
||||
@insertAt(index, child)
|
||||
@state.get('children').insert(index, child.getState()) if options.updateState ? true
|
||||
state = child.getState()
|
||||
@state.get('children').insert(index, state) if options.updateState ? true
|
||||
@getContainer()?.adjustPaneDimensions()
|
||||
|
||||
removeChild: (child, options={}) ->
|
||||
|
||||
Reference in New Issue
Block a user