Skip to content

Instantly share code, notes, and snippets.

View barbieswimcrew's full-sized avatar
🥃
sláinte

Mrtn Schndlr barbieswimcrew

🥃
sláinte
View GitHub Profile
import HttpClient from "./HttpClient";
export default class FormHandler {
/**
* Asynchronous form submit
* @param {HTMLFormElement} form
* @param {HttpClient} client
* @param {function} callback
/**
* On submitting the form the OffCanvas shall open, the product has to be posted
* against the storefront api and after that the current cart template needs to
* be fetched and shown inside the OffCanvas
* @param {Event} e
* @private
*/
_onFormSubmit(e) {
e.preventDefault();
import StringHelper from 'src/script/helper/string.helper';
export default class DomAccess {
/**
* Returns whether or not the element is an HTML node
*
* @param {HTMLElement} element
* @returns {boolean}
*/
export default class HttpClient {
/**
* Constructor.
* @param {string} accessKey
* @param {string} contextToken
*/
constructor(accessKey, contextToken) {
this._request = null;
this._accessKey = accessKey;
export default class HttpClient {
/**
* Constructor.
* @param {string} accessKey
* @param {string} contextToken
*/
constructor(accessKey, contextToken) {
this._accessKey = accessKey;
this._contextToken = contextToken;
export default class DeviceDetection {
/**
* Returns whether the current device is a touch device
* @returns {boolean}
*/
static isTouchDevice() {
return ("ontouchstart" in document.documentElement);
}
function findByQuery(query) {
let i, results = [];
for (i in window.localStorage) {
if (window.localStorage.hasOwnProperty(i)) {
if (i.match(query) || (!query && typeof i === 'string')) {
results.push(i);
}
}
}
return results;
html.no--scroll {
position: relative;
overflow: hidden;
}
/**
* The definition of html:before will be needed to
* determine the current viewport via JS because
* CSS holds the single version of truth
*/
const webpack = require('webpack');
const WebpackBar = require('webpackbar');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const {resolve} = require('path');
const config = require('../config');
const buildDirectory = resolve(process.env.PROJECT_ROOT, 'public');
const publicPath = `${process.env.APP_URL}${(process.env.ENV === 'watch') ? `:${config.devServerPort}` : ''}/`;
/**
const webpack = require('webpack');
const WebpackBar = require('webpackbar');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const {resolve} = require('path');
const config = require('../config');
const buildDirectory = resolve(process.env.PROJECT_ROOT, 'public');
const publicPath = `${process.env.APP_URL}${(process.env.ENV === 'watch') ? `:${config.devServerPort}` : ''}/`;
/**