From 98c8130705c6ffbf1ce4f0cf43f8654d5f5d7615 Mon Sep 17 00:00:00 2001 From: abe33 Date: Wed, 3 Dec 2014 12:59:52 +0100 Subject: [PATCH] Add an observeMinimaps method replacing eachMinimapView --- lib/mixins/view-management.coffee | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/mixins/view-management.coffee b/lib/mixins/view-management.coffee index 32b56e02..a9e16edc 100644 --- a/lib/mixins/view-management.coffee +++ b/lib/mixins/view-management.coffee @@ -1,5 +1,6 @@ Mixin = require 'mixto' {CompositeDisposable} = require 'event-kit' +{deprecate} = require 'grim' MinimapView = null # Public: Provides methods to manage minimap views per pane. @@ -45,12 +46,19 @@ class ViewManagement extends Mixin # * view - The {MinimapView} instance # # Returns an {Object}. - eachMinimapView: (iterator) -> + observeMinimaps: (iterator) -> return unless iterator? iterator({view: minimapView}) for id,minimapView of @minimapViews createdCallback = (minimapView) -> iterator(minimapView) disposable = @onDidCreateMinimap(createdCallback) - off: => disposable.dispose() + disposable.off = -> + deprecate('Use Disposable::dispose instead') + disposable.dispose() + disposable + + eachMinimapView: (iterator) -> + deprecate('Use Minimap::observeMinimaps instead') + @observeMinimaps(iterator) # Internal: Destroys all views currently in use. destroyViews: ->