Skip to content

Instantly share code, notes, and snippets.

View poteto's full-sized avatar
🥔
ポテト

lauren poteto

🥔
ポテト
View GitHub Profile
_addObserverIfNotSpying() {
const viewportSpy = get(this, 'viewportSpy');
if (!viewportSpy) {
this.addObserver('viewportEntered', this, this._viewportDidEnter);
}
},
_viewportDidEnter() {
const viewportEntered = get(this, 'viewportEntered');
_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}`, () => {
_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);
},
_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]);
_teardown: on('willDestroyElement', function() {
this._unbindListeners();
}),
_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;
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; }
@mixin centerChildElement($childElement: 'div', $useFlexbox: true) {
@if $useFlexbox == true {
display: flex;
justify-content: center;
align-items: center;
} @else {
position: relative;
#{$childElement} {
position: absolute;
export function initialize(container, application) {
application.inject('component:bread-crumbs', 'applicationController', 'controller:application');
}
export default {
name: 'crumbly',
initialize
};
import Ember from 'ember';
import layout from '../templates/components/bread-crumbs';
const get = Ember.get;
const {
A: emberArray,
EnumerableUtils,
Component,
Logger,
computed,