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
<template> | |
<div :class="[namespace]"> | |
</div> | |
</template> | |
<script> | |
// Abstract | |
import Component from '@/components/component' | |
// Components |
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 default { | |
install(Vue, options) { | |
Vue.prototype.$state = options.store.state | |
Vue.prototype.$getters = options.store.getters | |
Vue.prototype.$commit = options.store.commit | |
Vue.prototype.$dispatch = options.store.dispatch | |
} | |
} |
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 default { | |
install(Vue, options) { | |
Vue.prototype.$bus = options.EventBus | |
} | |
} |
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
// http://wicky.nillia.ms/enquire.js/ | |
// https://www.sitepoint.com/javascript-media-queries/ | |
// https://modernweb.com/using-media-queries-in-javascript/ | |
// https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia | |
// https://coderwall.com/p/i817wa/one-line-function-to-detect-mobile-devices-with-javascript | |
const generateDebounce = require('lodash.debounce') | |
export default { | |
install(Vue, options = {}) { |
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
// Resources | |
import VeeValidate from 'vee-validate' | |
// Implementation | |
export default { | |
directives: { | |
validate: { | |
...VeeValidate.directive | |
} | |
}, |
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
// Uppercase.vue | |
<template> | |
<div> | |
<slot v-bind="{style: style}" /> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { |
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
/* eslint-disable space-before-function-paren */ | |
// As always with these things, YMMV. ;) | |
// https://github.com/stowball/Layout-Engine | |
// https://stackoverflow.com/a/14658198/4106263 | |
// https://en.wikipedia.org/wiki/Internet_Explorer_version_history | |
// https://stackoverflow.com/questions/9900311/how-do-i-target-only-internet-explorer-10-for-certain-situations-like-internet-e/14916454#14916454 | |
// Constants | |
const IE7_OR_LOWER = '<= 7' |
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
// https://j11y.io/jquery/#v=git&fn=jQuery.fn.outerHeight | |
// https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight | |
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop | |
// https://github.com/ramitos/dimensions/blob/master/src/dimensions.js | |
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight | |
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight | |
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect | |
export function isScrolled(el) { | |
return el.scrollTop + el.clientHeight === el.scrollHeight |
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
// https://github.com/joyqi/mobile-device-js | |
// TODO: Add Android | |
// Constants | |
const DEVICES = { | |
'Apple A7 GPU': { | |
1136: ['iPhone 5', 'iPhone 5s'], | |
2048: ['iPad Air', 'iPad Mini 2', 'iPad Mini 3'] | |
}, | |
'Apple A8 GPU': { |
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
// https://stackoverflow.com/questions/23757345/android-does-not-correctly-scroll-on-input-focus-if-not-body-element | |
export const androidScrollOnInputFocusPolyfill = () => { | |
if (document.activeElement.tagName === 'INPUT') { | |
window.setTimeout(function () { | |
document.activeElement.scrollIntoViewIfNeeded() | |
}, 0) | |
} | |
} |