|
|
|
|
@ -1,13 +1,17 @@ |
|
|
|
|
import $ from 'jquery'; |
|
|
|
|
import {showNotification} from "./notification" |
|
|
|
|
import Inputmask from "inputmask"; |
|
|
|
|
import SmoothScroll from 'smooth-scroll/dist/js/smooth-scroll'; |
|
|
|
|
import baguetteBox from 'baguettebox.js' |
|
|
|
|
import createHistory from 'history/createBrowserHistory' |
|
|
|
|
|
|
|
|
|
window.$ = window.jQuery = jQuery = $; |
|
|
|
|
window.Inputmask = Inputmask; |
|
|
|
|
window.baguetteBox = baguetteBox; |
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
const $popupAuth = $('.js-popup-auth'); |
|
|
|
|
let authPopupActiveTab = 'login' |
|
|
|
|
baguetteBox.run('.gallery'); |
|
|
|
|
// Добавляем заголовок X-CSRFToken для всех AJAX запросов JQuery.
|
|
|
|
|
$.ajaxSetup({ |
|
|
|
|
@ -41,11 +45,22 @@ $(document).ready(function () { |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(window.LIL_STORE.flags.isReferralRegistration && ! window.LIL_STORE.user.id){ |
|
|
|
|
setTimeout(() => { |
|
|
|
|
$('.js-header-enter').click(); |
|
|
|
|
}); |
|
|
|
|
if(window.LIL_STORE.flags.isReferralUrl){ |
|
|
|
|
if(window.LIL_STORE.user.id){ |
|
|
|
|
showNotification('error', 'Извините, вы уже зарегестрировались на нашем сервисе, получить бонусные баллы возможно только для новых пользователей'); |
|
|
|
|
// Создаем объект history API
|
|
|
|
|
const history = createHistory(); |
|
|
|
|
history.replace('/'); |
|
|
|
|
} |
|
|
|
|
else if(window.LIL_STORE.flags.referrer){ |
|
|
|
|
authPopupActiveTab = 'registration'; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
$('.js-header-enter').click(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$popupAuth.find(authPopupActiveTab == 'login' ? '.js-auth-type_login' : '.js-auth-type_registration').addClass('active'); |
|
|
|
|
$popupAuth.find(authPopupActiveTab == 'login' ? '.js-auth-tab_login' : '.js-auth-tab_registration').show(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function updateHeader() { |
|
|
|
|
|