This file contains hidden or 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 HttpClient from "./HttpClient"; | |
export default class FormHandler { | |
/** | |
* Asynchronous form submit | |
* @param {HTMLFormElement} form | |
* @param {HttpClient} client | |
* @param {function} callback |
This file contains hidden or 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
/** | |
* 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(); |
This file contains hidden or 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 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} | |
*/ |
This file contains hidden or 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 class HttpClient { | |
/** | |
* Constructor. | |
* @param {string} accessKey | |
* @param {string} contextToken | |
*/ | |
constructor(accessKey, contextToken) { | |
this._request = null; | |
this._accessKey = accessKey; |
This file contains hidden or 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 class HttpClient { | |
/** | |
* Constructor. | |
* @param {string} accessKey | |
* @param {string} contextToken | |
*/ | |
constructor(accessKey, contextToken) { | |
this._accessKey = accessKey; | |
this._contextToken = contextToken; |
This file contains hidden or 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 class DeviceDetection { | |
/** | |
* Returns whether the current device is a touch device | |
* @returns {boolean} | |
*/ | |
static isTouchDevice() { | |
return ("ontouchstart" in document.documentElement); | |
} |
This file contains hidden or 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
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; |
This file contains hidden or 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
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 | |
*/ |
This file contains hidden or 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
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}` : ''}/`; | |
/** |
This file contains hidden or 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
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}` : ''}/`; | |
/** |
NewerOlder