Skip to content

Commit

Permalink
Only register Ember.View.views for non virtual views
Browse files Browse the repository at this point in the history
  • Loading branch information
krisselden committed Jul 3, 2012
1 parent c28bdec commit 8826395
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ Ember.View = Ember.Object.extend(Ember.Evented,

// Register the view for event handling. This hash is used by
// Ember.EventDispatcher to dispatch incoming events.
Ember.View.views[get(this, 'elementId')] = this;
if (!this.isVirtual) Ember.View.views[get(this, 'elementId')] = this;

var childViews = get(this, '_childViews').slice();

Expand Down Expand Up @@ -1745,7 +1745,6 @@ Ember.View = Ember.Object.extend(Ember.Evented,
// so collect any information we need before calling super.
var childViews = get(this, '_childViews'),
parent = get(this, '_parentView'),
elementId = get(this, 'elementId'),
childLen;

// destroy the element -- this will avoid each child view destroying
Expand Down Expand Up @@ -1774,7 +1773,7 @@ Ember.View = Ember.Object.extend(Ember.Evented,
}

// next remove view from global hash
delete Ember.View.views[get(this, 'elementId')];
if (!this.isVirtual) delete Ember.View.views[get(this, 'elementId')];
},

/**
Expand Down

0 comments on commit 8826395

Please sign in to comment.