Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(ele, option) {
this.opt = assign({}, defaults, option);
this.scrollAmount = -this.opt.offsetTop;
this.scrollOld = 0;
this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
this.targetWidth = this.targetElement.style.width;
this.targetBoxSizing = this.targetElement.style.boxSizing;
before(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
this.beforeElement = this.targetElement.previousElementSibling;
this.parentElement = this.targetElement.parentElement;
this.parentElement.style.position = 'relative';
window.addEventListener('scroll', () => {
this.onScroll();
});
window.addEventListener('resize', () => {
this.onScroll();
});
function LookForward(selector) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, LookForward);
this.options = assign({}, defaults, options);
this.id = (0, _util.getUniqId)();
var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
var body = document.querySelector('body');
this.currentUrl = location.href;
this.selector = selector;
this.historyLength = 0;
if (!eles) {
return;
}
[].forEach.call(eles, function (ele) {
_this.addClickEvent(ele);
});
(0, _util.append)(body, '<div id="' + this.id + '"></div>');
if (window.history && this.options.useHistoryApi) {
window.addEventListener('popstate', function (event) {
var state = event.state;
constructor(selector, options = {}) {
this.options = assign({}, defaults, options);
this.id = getUniqId();
const eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
const body = document.querySelector('body');
this.currentUrl = location.href;
this.selector = selector;
this.historyLength = 0;
if (!eles) {
return;
}
[].forEach.call(eles, (ele) => {
this.addClickEvent(ele);
});
append(body, `<div id="${this.id}"></div>`);
if (window.history && this.options.useHistoryApi) {
window.addEventListener('popstate', (event) => {
const state = event.state;
function LookForward(selector) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, LookForward);
this.options = assign({}, defaults, options);
this.id = (0, _util.getUniqId)();
var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
var body = document.querySelector('body');
this.currentUrl = location.href;
this.selector = selector;
this.historyLength = 0;
if (!eles) {
return;
}
[].forEach.call(eles, function (ele) {
_this.addClickEvent(ele);
});
(0, _util.append)(body, '<div id="' + this.id + '"></div>');
if (window.history && this.options.useHistoryApi) {
window.addEventListener('popstate', function (event) {
var state = event.state;
function ModalVideo(ele, option) {
var _this = this;
_classCallCheck(this, ModalVideo);
var opt = assign({}, defaults, option);
var selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
var body = document.querySelector('body');
var classNames = opt.classNames;
var speed = opt.animationSpeed;
[].forEach.call(selectors, function (selector) {
selector.addEventListener('click', function (event) {
if (selector.tagName === 'A') {
event.preventDefault();
}
var videoId = selector.dataset.videoId;
var channel = selector.dataset.channel || opt.channel;
var id = (0, _util.getUniqId)();
var videoUrl = selector.dataset.videoUrl || _this.getVideoUrl(opt, channel, videoId);
var html = _this.getHtml(opt, videoUrl, id);
(0, _util.append)(body, html);
var modal = document.getElementById(id);
function PrettyScroll(ele, option) {
var _this = this;
_classCallCheck(this, PrettyScroll);
this.opt = assign({}, defaults, option);
this.scrollAmount = -this.opt.offsetTop;
this.scrollOld = 0;
this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
this.targetWidth = this.targetElement.style.width;
this.targetBoxSizing = this.targetElement.style.boxSizing;
(0, _util.before)(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
this.beforeElement = this.targetElement.previousElementSibling;
this.parentElement = this.targetElement.parentElement;
this.parentElement.style.position = 'relative';
window.addEventListener('scroll', function () {
_this.onScroll();
});
window.addEventListener('resize', function () {
_this.onScroll();
});
function PrettyScroll(ele, option) {
var _this = this;
_classCallCheck(this, PrettyScroll);
this.opt = assign({}, defaults, option);
this.scrollAmount = -this.opt.offsetTop;
this.scrollOld = 0;
this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
this.targetWidth = this.targetElement.style.width;
this.targetBoxSizing = this.targetElement.style.boxSizing;
(0, _util.before)(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
this.beforeElement = this.targetElement.previousElementSibling;
this.parentElement = this.targetElement.parentElement;
this.parentElement.style.position = 'relative';
window.addEventListener('scroll', function () {
_this.onScroll();
});
window.addEventListener('resize', function () {
_this.onScroll();
});
function LookForward(selector) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, LookForward);
this.options = assign({}, defaults, options);
this.id = (0, _util.getUniqId)();
var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
var body = document.querySelector('body');
this.currentUrl = location.href;
this.selector = selector;
this.historyLength = 0;
if (!eles) {
return;
}
[].forEach.call(eles, function (ele) {
_this.addClickEvent(ele);
});
(0, _util.append)(body, '<div id="' + this.id + '"></div>');
if (window.history && this.options.useHistoryApi) {
window.addEventListener('popstate', function (event) {
var state = event.state;
function ModalVideo(ele, option) {
var _this = this;
_classCallCheck(this, ModalVideo);
var opt = assign({}, defaults, option);
var selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
var body = document.querySelector('body');
var classNames = opt.classNames;
var speed = opt.animationSpeed;
[].forEach.call(selectors, function (selector) {
selector.addEventListener('click', function (event) {
if (selector.tagName === 'A') {
event.preventDefault();
}
var videoId = selector.dataset.videoId;
var channel = selector.dataset.channel || opt.channel;
var id = (0, _util.getUniqId)();
var videoUrl = selector.dataset.videoUrl || _this.getVideoUrl(opt, channel, videoId);
var html = _this.getHtml(opt, videoUrl, id);
(0, _util.append)(body, html);
var modal = document.getElementById(id);
constructor(ele, option) {
const opt = assign({}, defaults, option);
const selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
const body = document.querySelector('body');
const classNames = opt.classNames;
const speed = opt.animationSpeed;
[].forEach.call(selectors, (selector) => {
selector.addEventListener('click', (event) => {
if (selector.tagName === 'A') {
event.preventDefault();
}
const videoId = selector.dataset.videoId;
const channel = selector.dataset.channel || opt.channel;
const id = getUniqId();
const videoUrl = selector.dataset.videoUrl || this.getVideoUrl(opt, channel, videoId);
const html = this.getHtml(opt, videoUrl, id);
append(body, html);
const modal = document.getElementById(id);