Skip to content

Instantly share code, notes, and snippets.

@ppcano
Created December 27, 2011 16:04
Show Gist options
  • Save ppcano/1524133 to your computer and use it in GitHub Desktop.
Save ppcano/1524133 to your computer and use it in GitHub Desktop.
Observes a view to be notified after DOM insertion
ControlledView = SC.Mixin.create({
isInsertedElement: false,
didInsertElement: function(){
set(this, 'isInsertedElement', true);
}
});
SC.addObserver(view, 'isInsertedElement' ,function() {
var deviceHeight = $(window).height();
.....
// Do something
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment