-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Component should be recalculating sticky dimension and position on document resize, otherwise it doesn't work correctly with RWD.
import Ember from 'ember';
import StickyContainer from 'ember-cli-sticky/components/sticky-container';
const WINDOW = Ember.$(window);
export default StickyContainer.extend({
addResizeHandler: Ember.on('didInsertElement', function() {
const updateSticky = () => this.$().sticky('update');
WINDOW.on('resize.sticky-container', () => {
Ember.run.debounce(this, updateSticky, 100);
});
}),
detachResizeHandler: Ember.on('willDestroyElement', function() {
WINDOW.off('.sticky-container');
})
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels