This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_addObserverIfNotSpying() { | |
const viewportSpy = get(this, 'viewportSpy'); | |
if (!viewportSpy) { | |
this.addObserver('viewportEntered', this, this._viewportDidEnter); | |
} | |
}, | |
_viewportDidEnter() { | |
const viewportEntered = get(this, 'viewportEntered'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_bindListeners(context=null, event=null) { | |
Ember.assert('You must pass a valid context to _bindListeners', context); | |
Ember.assert('You must pass a valid event to _bindListeners', event); | |
const elementId = get(this, 'elementId'); | |
Ember.warn('No elementId was found on this Object, `viewportSpy` will' + | |
'not work as expected', elementId); | |
$(context).on(`${event}#${elementId}`, () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_scrollHandler(context=null) { | |
Ember.assert('You must pass a valid context to _scrollHandler', context); | |
const viewportRefreshRate = get(this, 'viewportRefreshRate'); | |
debounce(this, function() { | |
this._setViewportEntered(context); | |
}, viewportRefreshRate); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_unbindListeners() { | |
const elementId = get(this, 'elementId'); | |
const viewportUseRAF = get(this, 'viewportUseRAF'); | |
Ember.warn('No elementId was found on this Object, `viewportSpy` will' + | |
'not work as expected', elementId); | |
if (viewportUseRAF) { | |
next(this, () => { | |
window.cancelAnimationFrame(rAFIDS[elementId]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_teardown: on('willDestroyElement', function() { | |
this._unbindListeners(); | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_setViewportEntered(context=null) { | |
Ember.assert('You must pass a valid context to _setViewportEntered', context); | |
const $viewportCachedEl = get(this, '$viewportCachedEl'); | |
const viewportUseRAF = get(this, 'viewportUseRAF'); | |
const elementId = get(this, 'elementId'); | |
const tolerance = get(this, 'viewportTolerance'); | |
const height = $(context) ? $(context).height() : 0; | |
const width = $(context) ? $(context).width() : 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meta.foundation-version { | |
font-family: "/5.5.1/"; } | |
meta.foundation-mq-small { | |
font-family: "/only screen/"; | |
width: 0; } | |
meta.foundation-mq-small-only { | |
font-family: "/only screen and (max-width: 40em)/"; | |
width: 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin centerChildElement($childElement: 'div', $useFlexbox: true) { | |
@if $useFlexbox == true { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} @else { | |
position: relative; | |
#{$childElement} { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function initialize(container, application) { | |
application.inject('component:bread-crumbs', 'applicationController', 'controller:application'); | |
} | |
export default { | |
name: 'crumbly', | |
initialize | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import layout from '../templates/components/bread-crumbs'; | |
const get = Ember.get; | |
const { | |
A: emberArray, | |
EnumerableUtils, | |
Component, | |
Logger, | |
computed, |