From 2f7fb3f565cbc1312295046cb1e8501e500eeb23 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 6 Apr 2017 13:01:17 -0600 Subject: [PATCH] Remove PaneContainer.monitorPaneItems --- src/pane-container.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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) - } - })) - } }