Permalink
Browse files

Instead of just unsetting a pane's layer when it gets removed, comple…

…tely destroy its layer. This will ensure proper handling of events and child views.
  • Loading branch information...
1 parent c955d2f commit 61b15045ff5cb2291b721cd86a87e4129a99fbda @ColinCampbell ColinCampbell committed Jul 7, 2011
@@ -80,6 +80,20 @@ SC.TextFieldSupport = /** @scope SC.TextFieldSupport */{
});
},
+ willDestroyLayerMixin: function() {
+ var input = this.$input();
+
+ if (SC.browser.msie) {
+ SC.Event.remove(input, 'focusin', this, this.focusIn);
+ SC.Event.remove(input, 'focusout', this, this.focusOut);
+ } else {
+ SC.Event.remove(input, 'focus', this, this.focusIn);
+ SC.Event.remove(input, 'blur', this, this.focusOut);
+ }
+
+ input.unbind('change');
+ },
+
focusIn: function(event) {
this.becomeFirstResponder();
this.tryToPerform('focus', event);
@@ -440,7 +440,7 @@ SC.Pane = SC.View.extend(SC.ResponderContext,
dom = null ;
// layer is cached by SC.View in this._view_layer, remove it so that the DOM node can be freed
- this._view_layer = null;
+ this.destroyLayer();
// remove intercept
this._removeIntercept();

0 comments on commit 61b1504

Please sign in to comment.