diff --git a/src/pane-container.js b/src/pane-container.js index 95a3737e7..e95cde37e 100644 --- a/src/pane-container.js +++ b/src/pane-container.js @@ -20,7 +20,6 @@ class PaneContainer { this.setRoot(new Pane({container: this, config: this.config, applicationDelegate, notificationManager, deserializerManager, viewRegistry: this.viewRegistry})) this.setActivePane(this.getRoot()) - this.monitorPaneItems() } initialize () { @@ -264,6 +263,11 @@ class PaneContainer { didAddPane (event) { this.emitter.emit('did-add-pane', event) + const items = event.pane.getItems() + for (let i = 0, length = items.length; i < length; i++) { + const item = items[i] + this.didAddPaneItem(item, event.pane, i) + } } willDestroyPane (event) { @@ -306,14 +310,4 @@ class PaneContainer { this.subscriptions.add(childSubscription) })) } - - monitorPaneItems () { - this.subscriptions.add(this.observePanes(pane => { - const iterable = pane.getItems() - for (let index = 0; index < iterable.length; index++) { - const item = iterable[index] - this.didAddPaneItem(item, pane, index) - } - })) - } }