Skip to content

Instantly share code, notes, and snippets.

@sjmiles
Created December 18, 2013 19:55
Show Gist options
  • Save sjmiles/8028778 to your computer and use it in GitHub Desktop.
Save sjmiles/8028778 to your computer and use it in GitHub Desktop.
ready: function() {
this.resizeListeners = [];
if (!this.fire('request-resize-advice', {sender: this, ok: false}, this.parentNode).ok) {
console.log('using window resize');
window.addEventListener('resize', this.resize.bind(this));
} else {
console.log('using ancestor resize');
}
},
requestResizeAdvice: function(event, detail) {
this.resizeListeners.push(detail.sender);
detail.ok = true;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment