Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 1);
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./js/frontend.js":
- /*!************************!*\
- !*** ./js/frontend.js ***!
- \************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var CmsmastersFrontend = function CmsmastersFrontend() {
- var _this = this,
- initOnReadyComponents = function initOnReadyComponents() {
- _this.widgetsHandler = {
- // Testimonials Grid
- 'cmsmasters-testimonials-grid.default': __webpack_require__(/*! ./widgets/testimonials-grid.js */ "./js/widgets/testimonials-grid.js"),
- // Testimonials Slider
- 'cmsmasters-testimonials-slider.default': __webpack_require__(/*! ./widgets/testimonials-slider.js */ "./js/widgets/testimonials-slider.js"),
- // Tab
- 'cmsmasters-tabs.default': __webpack_require__(/*! ./widgets/tabs.js */ "./js/widgets/tabs.js"),
- // Toggles
- 'cmsmasters-toggles.default': __webpack_require__(/*! ./widgets/toggles.js */ "./js/widgets/toggles.js"),
- 'cmsmasters-menu..default': __webpack_require__(/*! ./widgets/search.js */ "./js/widgets/search.js"),
- 'cmsmasters-menu.default': __webpack_require__(/*! ./widgets/search.js */ "./js/widgets/menu.js")
- };
- },
- addElementsHandlers = function addElementsHandlers() {
- jQuery.each(_this.widgetsHandler, function (widgetName, widgetObject) {
- elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, widgetObject);
- });
- };
- this.init = function () {
- initOnReadyComponents();
- addElementsHandlers();
- };
- };
- window.cmsmastersFrontend = new CmsmastersFrontend();
- jQuery(window).on('elementor/frontend/init', function () {
- cmsmastersFrontend.init();
- });
- /***/ }),
- /***/ "./js/modules/image-carousel-base.js":
- /*!*******************************************!*\
- !*** ./js/modules/image-carousel-base.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = elementorFrontend.Module.extend({
- // Get Default Settings Function
- getDefaultSettings: function getDefaultSettings() {
- return {
- selectors: {
- mainSwiper: '.cmsmasters_testimonials_cont',
- swiperSlide: '.swiper-slide'
- },
- slidesPerView: {
- desktop: 3,
- tablet: 2,
- mobile: 1
- }
- };
- },
- // Get Default Elements Function
- getDefaultElements: function getDefaultElements() {
- var selectors = this.getSettings('selectors'),
- elements = {
- $mainSwiper: this.$element.find(selectors.mainSwiper)
- };
- elements.$mainSwiperSlides = elements.$mainSwiper.find(selectors.swiperSlide);
- return elements;
- },
- getSlidesCount: function getSlidesCount() {
- return this.elements.$mainSwiperSlides.length;
- },
- // Get Slides Per View Function
- getDeviceSlidesPerView: function getDeviceSlidesPerView(device) {
- var slidesPerViewKey = 'slides_per_view' + ('desktop' === device ? '' : '_' + device);
- return Math.min(this.getSlidesCount(), +this.getElementSettings(slidesPerViewKey) || this.getSettings('slidesPerView')[device]);
- },
- getSlidesPerView: function getSlidesPerView(device) {
- return this.getDeviceSlidesPerView(device);
- },
- getDesktopSlidesPerView: function getDesktopSlidesPerView() {
- return this.getSlidesPerView('desktop');
- },
- getTabletSlidesPerView: function getTabletSlidesPerView() {
- return this.getSlidesPerView('tablet');
- },
- getMobileSlidesPerView: function getMobileSlidesPerView() {
- return this.getSlidesPerView('mobile');
- },
- // Get Slides To Scroll Function
- getDeviceSlidesToScroll: function getDeviceSlidesToScroll(device) {
- var slidesToScrollKey = 'slides_per_view' + ('desktop' === device ? '' : '_' + device);
- return Math.min(this.getSlidesCount(), +this.getElementSettings(slidesToScrollKey) || 1);
- },
- getSlidesToScroll: function getSlidesToScroll(device) {
- return this.getDeviceSlidesToScroll(device);
- },
- getDesktopSlidesToScroll: function getDesktopSlidesToScroll() {
- return this.getSlidesToScroll('desktop');
- },
- getTabletSlidesToScroll: function getTabletSlidesToScroll() {
- return this.getSlidesToScroll('tablet');
- },
- getMobileSlidesToScroll: function getMobileSlidesToScroll() {
- return this.getSlidesToScroll('mobile');
- },
- // Get Swiper Options Value
- getInitialSlide: function getInitialSlide() {
- var editSettings = this.getEditSettings();
- return editSettings.activeItemIndex ? editSettings.activeItemIndex - 1 : 0;
- },
- getNavigation: function getNavigation(type) {
- if (this.getSlidesCount() > this.getElementSettings('slides_per_view')) {
- if (type === 'arrows') {
- return {
- prevEl: '.cmsmasters_arrow_button_prev',
- nextEl: '.cmsmasters_arrow_button_next'
- };
- } else if (type === 'pagination') {
- return {
- el: '.cmsmasters_pagination',
- type: 'bullets',
- clickable: true
- };
- }
- } else {
- return false;
- }
- },
- // Get Swiper Options Function
- getSwiperOptions: function getSwiperOptions() {
- var elementSettings = this.getElementSettings(),
- breakpointsSettings = {},
- breakpoints = elementorFrontend.config.breakpoints;
- breakpointsSettings[breakpoints.lg - 1] = {
- slidesPerView: this.getTabletSlidesPerView(),
- slidesPerGroup: this.getTabletSlidesToScroll()
- };
- breakpointsSettings[breakpoints.md - 1] = {
- slidesPerView: this.getMobileSlidesPerView(),
- slidesPerGroup: this.getMobileSlidesToScroll()
- };
- var swiperOptions = {
- navigation: this.getNavigation('arrows'),
- pagination: this.getNavigation('pagination'),
- grabCursor: true,
- slideToClickedSlide: true,
- initialSlide: this.getInitialSlide(),
- slidesPerView: this.getDesktopSlidesPerView(),
- slidesPerGroup: this.getDesktopSlidesToScroll(),
- loop: 'yes' === elementSettings.loop,
- speed: elementSettings.speed,
- breakpoints: breakpointsSettings
- };
- if (!this.isEdit && elementSettings.autoplay) {
- swiperOptions.autoplay = {
- delay: elementSettings.autoplay_speed,
- disableOnInteraction: !!elementSettings.pause_on_interaction
- };
- }
- return swiperOptions;
- },
- // Get Change Function
- onElementChange: function onElementChange(propertyName) {
- if (1 >= this.getSlidesCount()) {
- return;
- }
- if (0 === propertyName.indexOf('width')) {
- this.swipers.main.update();
- }
- },
- onEditSettingsChange: function onEditSettingsChange(propertyName) {
- if (1 >= this.getSlidesCount()) {
- return;
- }
- if ('activeItemIndex' === propertyName) {
- this.swipers.main.slideToLoop(this.getEditSettings('activeItemIndex') - 1);
- }
- },
- // Get onInit Function
- onInit: function onInit() {
- elementorFrontend.Module.prototype.onInit.apply(this, arguments);
- this.swipers = {};
- if (1 >= this.getSlidesCount()) {
- return;
- }
- this.swipers.main = new Swiper(this.elements.$mainSwiper, this.getSwiperOptions());
- }
- });
- /***/ }),
- /***/ "./js/modules/tabs-base.js":
- /*!*********************************!*\
- !*** ./js/modules/tabs-base.js ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = elementorFrontend.Module.extend({
- $activeContent: null,
- // Get Default Settings Function
- getDefaultSettings: function getDefaultSettings() {
- return {
- selectors: {
- tabTitle: null,
- tabContent: null
- },
- classes: {
- active_tab: null
- },
- showTabFn: 'show',
- hideTabFn: 'hide',
- toggleSelf: true,
- hidePrevious: true,
- autoExpand: true
- };
- },
- // Get Default Elements Function
- getDefaultElements: function getDefaultElements() {
- var selectors = this.getSettings('selectors');
- return {
- $tabTitles: this.findElement(selectors.tabTitle),
- $tabContents: this.findElement(selectors.tabContent)
- };
- },
- activateDefaultTab: function activateDefaultTab() {
- var settings = this.getSettings();
- if (!settings.autoExpand || 'editor' === settings.autoExpand && !this.isEdit) {
- return;
- }
- var defaultActiveTab = this.getEditSettings('activeItemIndex') || 1,
- originalToggleMethods = {
- showTabFn: settings.showTabFn,
- hideTabFn: settings.hideTabFn
- }; // Toggle tabs without animation to avoid jumping
- this.setSettings({
- showTabFn: 'show',
- hideTabFn: 'hide'
- });
- this.changeActiveTab(defaultActiveTab); // Return back original toggle effects
- this.setSettings(originalToggleMethods);
- },
- deactivateActiveTab: function deactivateActiveTab(tabIndex) {
- var settings = this.getSettings(),
- activeClass = settings.classes.active_tab,
- activeFilter = tabIndex ? '[data-tab="' + tabIndex + '"]' : '.' + activeClass,
- $activeTitle = this.elements.$tabTitles.filter(activeFilter),
- $activeContent = this.elements.$tabContents.filter(activeFilter);
- $activeTitle.add($activeContent).removeClass(activeClass);
- $activeContent[settings.hideTabFn]();
- },
- activateTab: function activateTab(tabIndex) {
- var settings = this.getSettings(),
- activeClass = settings.classes.active_tab,
- $requestedTitle = this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]'),
- $requestedContent = this.elements.$tabContents.filter('[data-tab="' + tabIndex + '"]');
- $requestedTitle.add($requestedContent).addClass(activeClass);
- $requestedContent[settings.showTabFn]();
- },
- isActiveTab: function isActiveTab(tabIndex) {
- return this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]').hasClass(this.getSettings('classes.active_tab'));
- },
- bindEvents: function bindEvents() {
- var _this = this;
- this.elements.$tabTitles.on({
- keydown: function keydown(event) {
- if ('Enter' === event.key) {
- event.preventDefault();
- _this.changeActiveTab(event.currentTarget.dataset.tab);
- }
- },
- click: function click(event) {
- event.preventDefault();
- _this.changeActiveTab(event.currentTarget.dataset.tab);
- }
- });
- },
- onInit: function onInit() {
- elementorModules.frontend.handlers.Base.prototype.onInit.apply(this, arguments);
- this.activateDefaultTab();
- },
- onEditSettingsChange: function onEditSettingsChange(propertyName) {
- if ('activeItemIndex' === propertyName) {
- this.activateDefaultTab();
- }
- },
- changeActiveTab: function changeActiveTab(tabIndex) {
- var isActiveTab = this.isActiveTab(tabIndex),
- settings = this.getSettings();
- if ((settings.toggleSelf || !isActiveTab) && settings.hidePrevious) {
- this.deactivateActiveTab();
- }
- if (!settings.hidePrevious && isActiveTab) {
- this.deactivateActiveTab(tabIndex);
- }
- if (!isActiveTab) {
- this.activateTab(tabIndex);
- }
- }
- });
- /***/ }),
- /***/ "./js/widgets/tabs.js":
- /*!****************************!*\
- !*** ./js/widgets/tabs.js ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Base = __webpack_require__(/*! ../modules/tabs-base */ "./js/modules/tabs-base.js"),
- Tabs;
- Tabs = Base.extend({
- getDefaultSettings: function getDefaultSettings() {
- var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments);
- defaultSettings.selectors = {
- tabTitle: '.cmsmasters_tabs_list_item',
- tabContent: '.cmsmasters_tab'
- };
- defaultSettings.classes = {
- active_tab: 'active_tab'
- };
- defaultSettings.toggleSelf = false;
- return defaultSettings;
- },
- onInit: function onInit() {
- Base.prototype.onInit.apply(this, arguments);
- }
- });
- module.exports = function ($scope) {
- new Tabs({
- $element: $scope
- });
- };
- /***/ }),
- /***/ "./js/widgets/testimonials-grid.js":
- /*!*****************************************!*\
- !*** ./js/widgets/testimonials-grid.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Icon = __webpack_require__(/*! ./testimonials-icon */ "./js/widgets/testimonials-icon.js"),
- TestimonialsGrid = elementorFrontend.Module.extend({
- getDefaultElements: function getDefaultElements() {
- var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
- $testimonials_icon_main = this.findElement('.cmsmasters_testimonials_icon_main'),
- $testimonials_icon_additional = this.findElement('.cmsmasters_testimonials_icon_additional'),
- $testimonials_container = this.findElement('.cmsmasters_testimonials_grid');
- defaultElements.$testimonials_icon_main = $testimonials_icon_main;
- defaultElements.$testimonials_icon_additional = $testimonials_icon_additional;
- defaultElements.$testimonials_container = $testimonials_container;
- return defaultElements;
- },
- initIcon: function initIcon() {
- if (this.isEdit) {
- new Icon({
- widget: this,
- $TestimonialsIconMain: this.elements.$testimonials_icon_main,
- $TestimonialsIconAdditional: this.elements.$testimonials_icon_additional,
- $TestimonialsContainer: this.elements.$testimonials_container,
- mainControlsName: {
- y: 'testimonials_item_icon_position_y',
- x: 'testimonials_item_icon_position_x'
- },
- additionalControlsName: {
- y: 'testimonials_item_icon_additional_position_y',
- x: 'testimonials_item_icon_additional_position_x'
- }
- });
- }
- },
- onInit: function onInit() {
- elementorFrontend.Module.prototype.onInit.apply(this, arguments);
- this.initIcon();
- }
- });
- module.exports = function ($scope) {
- new TestimonialsGrid({
- $element: $scope
- });
- };
- /***/ }),
- /***/ "./js/widgets/testimonials-icon.js":
- /*!*****************************************!*\
- !*** ./js/widgets/testimonials-icon.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- var TestimonialsSliderIcons = elementorModules.ViewModule.extend({
- getDefaultSettings: function getDefaultSettings() {
- return {
- selectors: {
- $TestimonialsIconMain: null,
- $TestimonialsIconAdditional: null,
- $TestimonialsContainer: null
- }
- };
- },
- getDefaultElements: function getDefaultElements() {
- var _this$getSettings = this.getSettings(),
- $TestimonialsIconMain = _this$getSettings.$TestimonialsIconMain,
- $TestimonialsIconAdditional = _this$getSettings.$TestimonialsIconAdditional,
- $TestimonialsContainer = _this$getSettings.$TestimonialsContainer;
- return {
- $TestimonialsIconMain: $TestimonialsIconMain,
- $TestimonialsIconAdditional: $TestimonialsIconAdditional,
- $TestimonialsContainer: $TestimonialsContainer
- };
- },
- isEditable: function isEditable() {
- var _this$getSettings2 = this.getSettings(),
- widget = _this$getSettings2.widget;
- return widget.$element.hasClass('elementor-element-editable');
- },
- returnStopDefaultEvent: function returnStopDefaultEvent(event) {
- if (this.isEditable()) return this.stopDefaultEvent(event);
- return true;
- },
- initDraggable: function initDraggable() {
- this.elements.$TestimonialsIconMain.on('mousedown', this.returnStopDefaultEvent).draggable({
- iframeFix: true,
- containment: "parent",
- create: function create(event, ui) {
- jQuery('.cmsmasters_testimonials_icon_main').css({
- cursor: "grab"
- });
- },
- start: function start(event, ui) {
- jQuery('.cmsmasters_testimonials_icon_main').css({
- cursor: "grabbing"
- });
- },
- drag: this.handleDraggableDragMain.bind(this),
- stop: this.handleDraggableEndMain.bind(this)
- });
- this.elements.$TestimonialsIconAdditional.on('mousedown', this.returnStopDefaultEvent).draggable({
- iframeFix: true,
- containment: "parent",
- create: function create(event, ui) {
- jQuery('.cmsmasters_testimonials_icon_additional').css({
- cursor: "grab"
- });
- },
- start: function start(event, ui) {
- jQuery('.cmsmasters_testimonials_icon_additional').css({
- cursor: "grabbing"
- });
- },
- drag: this.handleDraggableDragAdditional.bind(this),
- stop: this.handleDraggableEndAdditional.bind(this)
- });
- },
- handleDraggableDragMain: function handleDraggableDragMain(event, ui) {
- var helper = ui.helper,
- position = ui.position;
- this.elements.$TestimonialsIconMain.not(helper).css({
- top: position.top,
- left: position.left
- });
- },
- handleDraggableDragAdditional: function handleDraggableDragAdditional(event, ui) {
- var helper = ui.helper,
- position = ui.position;
- this.elements.$TestimonialsIconAdditional.not(helper).css({
- top: position.top,
- left: position.left
- });
- },
- handleDraggableEndMain: function handleDraggableEndMain(event, ui) {
- var $TestimonialsIconMain = ui.helper,
- position = ui.position,
- positionPercent = this.getPositionsPrecent(position.top, position.left);
- if (positionPercent.top > 100 || positionPercent.left > 100) {
- positionPercent = this.getPositionsPrecent(position.top, position.left);
- debugger;
- }
- this.savePositionsMain(positionPercent);
- $TestimonialsIconMain.css({
- top: positionPercent.topP,
- left: positionPercent.leftP,
- cursor: "grab"
- });
- },
- handleDraggableEndAdditional: function handleDraggableEndAdditional(event, ui) {
- var $TestimonialsIconAdditional = ui.helper,
- position = ui.position,
- positionPercent = this.getPositionsPrecent(position.top, position.left);
- if (positionPercent.top > 100 || positionPercent.left > 100) {
- positionPercent = this.getPositionsPrecent(position.top, position.left);
- debugger;
- }
- this.savePositionsAdditional(positionPercent);
- $TestimonialsIconAdditional.css({
- top: positionPercent.topP,
- left: positionPercent.leftP,
- cursor: "grab"
- });
- },
- savePositionsMain: function savePositionsMain(positions) {
- var _this$getSettings3 = this.getSettings(),
- widget = _this$getSettings3.widget,
- mainControlsName = _this$getSettings3.mainControlsName,
- modelCID = widget.getModelCID(),
- model = elementorFrontend.config.elements.data[modelCID];
- model.attributes[mainControlsName.y] = positions.top;
- model.attributes[mainControlsName.x] = positions.left;
- elementorFrontend.config.elements.data[modelCID] = model;
- elementor.saver.setFlagEditorChange(true);
- },
- savePositionsAdditional: function savePositionsAdditional(positions) {
- var _this$getSettings4 = this.getSettings(),
- widget = _this$getSettings4.widget,
- additionalControlsName = _this$getSettings4.additionalControlsName,
- modelCID = widget.getModelCID(),
- model = elementorFrontend.config.elements.data[modelCID];
- model.attributes[additionalControlsName.y] = positions.top;
- model.attributes[additionalControlsName.x] = positions.left;
- elementorFrontend.config.elements.data[modelCID] = model;
- elementor.saver.setFlagEditorChange(true);
- },
- getPositionsPrecent: function getPositionsPrecent(topArr, leftArr) {
- var top = this.getTopPrecent(topArr),
- left = this.getLeftPrecent(leftArr);
- return {
- top: top,
- left: left,
- topP: top + '%',
- leftP: left + '%'
- };
- },
- getTopPrecent: function getTopPrecent(top) {
- return this.toPercent(top, this.elements.$TestimonialsContainer.height());
- },
- getLeftPrecent: function getLeftPrecent(left) {
- return this.toPercent(left, this.elements.$TestimonialsContainer.width());
- },
- toPercent: function toPercent() {
- return Number((Math.min(arguments[0], arguments[1]) / Math.max(arguments[0], arguments[1]) * 100).toFixed(3));
- },
- stopDefaultEvent: function stopDefaultEvent(event) {
- event.preventDefault();
- event.stopPropagation();
- return false;
- },
- onInit: function onInit() {
- elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
- this.initDraggable();
- }
- });
- module.exports = TestimonialsSliderIcons;
- /***/ }),
- /***/ "./js/widgets/testimonials-slider.js":
- /*!*******************************************!*\
- !*** ./js/widgets/testimonials-slider.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Base = __webpack_require__(/*! ../modules/image-carousel-base */ "./js/modules/image-carousel-base.js"),
- TestimonialsSlider,
- Icon = __webpack_require__(/*! ./testimonials-icon */ "./js/widgets/testimonials-icon.js");
- TestimonialsSlider = Base.extend({
- getDefaultSettings: function getDefaultSettings() {
- var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments);
- return defaultSettings;
- },
- getDefaultElements: function getDefaultElements() {
- var defaultElements = Base.prototype.getDefaultElements.apply(this, arguments),
- $testimonials_icon_main = this.findElement('.cmsmasters_testimonials_icon_main'),
- $testimonials_icon_additional = this.findElement('.cmsmasters_testimonials_icon_additional'),
- $testimonials_container = this.findElement('.cmsmasters_testimonial_item');
- defaultElements.$testimonials_icon_main = $testimonials_icon_main;
- defaultElements.$testimonials_icon_additional = $testimonials_icon_additional;
- defaultElements.$testimonials_container = $testimonials_container;
- return defaultElements;
- },
- getSlidesPerView: function getSlidesPerView(device) {
- return Base.prototype.getSlidesPerView.apply(this, arguments);
- },
- allowTouchMove: function allowTouchMove() {
- if (!this.isEdit) {
- return true;
- }
- },
- getSwiperOptions: function getSwiperOptions() {
- var options = Base.prototype.getSwiperOptions.apply(this, arguments),
- slidesCount = this.getSlidesCount();
- options.allowTouchMove = this.allowTouchMove();
- options.loopedSlides = slidesCount;
- options.onSlideChangeEnd = function (swiper) {
- if (loop) {
- swiper.fixLoop();
- }
- };
- return options;
- },
- initIcon: function initIcon() {
- if (this.isEdit) {
- new Icon({
- widget: this,
- $TestimonialsIconMain: this.elements.$testimonials_icon_main,
- $TestimonialsIconAdditional: this.elements.$testimonials_icon_additional,
- $TestimonialsContainer: this.elements.$testimonials_container,
- mainControlsName: {
- y: 'testimonials_item_icon_position_y',
- x: 'testimonials_item_icon_position_x'
- },
- additionalControlsName: {
- y: 'testimonials_item_icon_additional_position_y',
- x: 'testimonials_item_icon_additional_position_x'
- }
- });
- }
- },
- onInit: function onInit() {
- Base.prototype.onInit.apply(this, arguments);
- this.initIcon();
- }
- });
- module.exports = function ($scope) {
- new TestimonialsSlider({
- $element: $scope
- });
- };
- /***/ }),
- /***/ "./js/widgets/toggles.js":
- /*!*******************************!*\
- !*** ./js/widgets/toggles.js ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Base = __webpack_require__(/*! ../modules/tabs-base */ "./js/modules/tabs-base.js"),
- Tabs;
- Tabs = Base.extend({
- getDefaultSettings: function getDefaultSettings() {
- var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments),
- elementSettings = this.getElementSettings();
- defaultSettings.selectors = {
- tabTitle: '.cmsmasters_toggle_title',
- tabContent: '.cmsmasters_toggle'
- };
- defaultSettings.classes = {
- active_tab: 'active_tab'
- };
- defaultSettings.showTabFn = 'slideDown';
- defaultSettings.hideTabFn = 'slideUp';
- if (elementSettings.toggle_mode == 'toggle') {
- defaultSettings.hidePrevious = false;
- }
- return defaultSettings;
- },
- onInit: function onInit() {
- Base.prototype.onInit.apply(this, arguments);
- }
- });
- module.exports = function ($scope) {
- new Tabs({
- $element: $scope
- });
- };
- /***/ }),
- /***/ "./js/widgets/search.js":
- /*!****************************!*\
- !*** ./js/widgets/search.js ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- const SearchWidget = elementorFrontend.Module.extend({
- getDefaultElements() {
- var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
- $elementor_element = this.findElement ( '.elementor-widget-cmsmasters-search' ),
- $cmsmasters_search = this.findElement( '.cmsmasters_search' ),
- $cmsmasters_search_container = this.findElement( '.cmsmasters_search_popup' ),
- $cmsmasters_search_field = this.findElement( '.cmsmasters_search_field' ),
- $cmsmasters_close_button = this.findElement( '.cmsmasters_search_popup_close' ),
- $cmsmasters_search_button = this.findElement( '.cmsmasters_search_popup_trigger' ),
- $cmsmasters_search_button_slide = this.findElement( '.cmsmasters_search_slide_button' ),
- $cmsmasters_search_slide_close = this.findElement( '.cmsmasters_search_slide_close' ),
- $cmsmasters_search_slide_button_full = this.findElement( '.cmsmasters_search_button_slide_full' ),
- $cmsmasters_search_slide_close_full = this.findElement( '.cmsmasters_search_slide_close_full' ),
- $cmsmasters_search_container_slide = this.findElement( '.cmsmasters_search_form_container' );
- defaultElements.$elementor_element = $elementor_element;
- defaultElements.$cmsmasters_search = $cmsmasters_search;
- defaultElements.$cmsmasters_search_field = $cmsmasters_search_field;
- defaultElements.$cmsmasters_search_container = $cmsmasters_search_container;
- defaultElements.$cmsmasters_close_button = $cmsmasters_close_button;
- defaultElements.$cmsmasters_search_button = $cmsmasters_search_button;
- defaultElements.$cmsmasters_search_button_slide = $cmsmasters_search_button_slide;
- defaultElements.$cmsmasters_search_slide_close = $cmsmasters_search_slide_close;
- defaultElements.$cmsmasters_search_slide_button_full = $cmsmasters_search_slide_button_full;
- defaultElements.$cmsmasters_search_slide_close_full = $cmsmasters_search_slide_close_full;
- defaultElements.$cmsmasters_search_container_slide = $cmsmasters_search_container_slide;
- return defaultElements;
- },
- bindEvents() {
- this.elements.$cmsmasters_search_button.on( 'click', this.onButtonClick.bind( this ) );
- this.elements.$cmsmasters_close_button.on( 'click', this.onButtonCloseClick.bind( this ) );
- if ( !this.elements.$cmsmasters_search_container.hasClass( "cmsmasters_overlay_not_close" ) ) {
- this.elements.$cmsmasters_search_container.on( 'click', this.onContainerClick.bind( this ) );
- }
- this.elements.$cmsmasters_search_slide_button_full.on( 'click', this.onButtonFullSlideClick.bind( this ) );
- this.elements.$cmsmasters_search_slide_close_full.on( 'click', this.onButtonFullSlideClick.bind( this ) );
- this.elements.$cmsmasters_search_button_slide.on( 'click', this.onButtonMinimalSlideClick.bind( this ) );
- this.elements.$cmsmasters_search_slide_close.on( 'click', this.onButtonMinimalSlideClick.bind( this ) );
- },
- onButtonClick( event ) {
- event.preventDefault();
- this.elements.$cmsmasters_search_container.addClass("cmsmasters_search_form_full_screen");
- if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
- document.getElementsByTagName("html")[0].style.overflow = 'hidden';
- }
- },
- onButtonCloseClick( event ) {
- event.preventDefault();
- this.elements.$cmsmasters_search_container.removeClass("cmsmasters_search_form_full_screen");
- if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
- document.getElementsByTagName("html")[0].style.overflow = 'inherit';
- }
- },
- onContainerClick( event ) {
- event.preventDefault();
- if (this.elements.$cmsmasters_search_container.hasClass("cmsmasters_search_form_full_screen") && this.elements.$cmsmasters_search_container[0] === event.target) {
- this.elements.$cmsmasters_search_container.removeClass("cmsmasters_search_form_full_screen");
- }
- if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
- document.getElementsByTagName("html")[0].style.overflow = 'inherit';
- }
- },
- onButtonMinimalSlideClick( event ) {
- event.preventDefault();
- this.elements.$cmsmasters_search_container_slide.toggleClass("active");
- },
- onButtonFullSlideClick( event ) {
- event.preventDefault();
- // For setTimeout
- var $that = this,
- $width = this.elements.$cmsmasters_search_container_slide.outerWidth(true),
- $width_btn = this.elements.$cmsmasters_search_slide_button_full.outerWidth(true);
- if ( ! this.elements.$cmsmasters_search_container_slide.hasClass("active") ) {
- this.elements.$cmsmasters_search_container_slide.css("left", "0");
- this.elements.$cmsmasters_search_container_slide.addClass("cmsmasters_in");
- setTimeout( function() {
- $that.elements.$cmsmasters_search_container_slide.removeClass("cmsmasters_in");
- $that.elements.$cmsmasters_search_container_slide.addClass("active");
- }, 300 );
- if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_button") ) {
- var $pos = this.elements.$cmsmasters_search_slide_button_full.position();
- this.elements.$cmsmasters_search_container_slide.css("left", ($pos.left + $width_btn/2) - $width/2);
- var $leftcss_container = +this.elements.$cmsmasters_search_container_slide.css("left").replace('px', ''),
- $container_postition = $leftcss_container + $width + this.elements.$cmsmasters_search.offset().left;
- if( $container_postition > window.innerWidth ) {
- this.elements.$cmsmasters_search_container_slide.css("left", ((($pos.left + $width_btn/2) - $width/2)) - ($container_postition - window.innerWidth) - 17);
- } else if ( this.elements.$cmsmasters_search_container_slide.offset().left < 0 ) {
- this.elements.$cmsmasters_search_container_slide.css("left", ((($pos.left + $width_btn/2) - $width/2)) - (this.elements.$cmsmasters_search_container_slide.offset().left / 2));
- }
- } else if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_block") ) {
- var $parent_id = this.elements.$cmsmasters_search_container_slide[0].attributes[0].value;
- var $position_parent = document.querySelector('[data-id="' + $parent_id + '"]').getBoundingClientRect().top + pageYOffset,
- $position_container = this.elements.$cmsmasters_search_container_slide.offset().top,
- $cmsmasters_search_height = this.elements.$cmsmasters_search.outerHeight(true),
- $height_container = this.elements.$cmsmasters_search_container_slide.outerHeight(true),
- $height_parent = document.querySelector('[data-id="' + $parent_id + '"]').offsetHeight;
- setTimeout( function() {
- alert('$position_parent' + $position_parent + '$position_container' + $position_container + '$height_parent' + $height_parent + '$height_container' + $height_container);
- }, 300 );
- this.elements.$cmsmasters_search_container_slide.css('bottom', -($position_parent - $position_container + $height_parent + $height_container)).css('top', 'auto').css('left', -(document.querySelector('[data-id="' + $parent_id + '"]').getBoundingClientRect().left));
- } else {
- var $pos = this.elements.$cmsmasters_search.offset();
- if ( $pos.left < $width ) {
- this.elements.$cmsmasters_search_container_slide.css("left", -$pos.left);
- } else {
- this.elements.$cmsmasters_search_container_slide.css("left", -($pos.left - $width/2));
- }
- }
- this.elements.$cmsmasters_search_field.focus();
- } else {
- this.elements.$cmsmasters_search_container_slide.removeClass("active");
- this.elements.$cmsmasters_search_container_slide.addClass("cmsmasters_out");
- this.elements.$cmsmasters_search_container_slide.css("left", "-999em");
- if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_block") ) {
- this.elements.$cmsmasters_search_container_slide.css("bottom", "auto");
- }
- setTimeout( function() {
- $that.elements.$cmsmasters_search_container_slide.removeClass("cmsmasters_out");
- }, 300 );
- }
- }
- });
- module.exports = function ($scope) {
- new SearchWidget({ $element: $scope });
- };
- /***/ }),
- /***/ "./js/widgets/menu.js":
- /*!****************************!*\
- !*** ./js/widgets/menu.js ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- const MenuWidget = elementorFrontend.Module.extend({
- getDefaultElements() {
- var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
- $cmsmasters_dropdown_button = this.findElement ( '.cmsmasters_nav_menu_toggle' ),
- $cmsmasters_dropdown_container = this.findElement ( '.cmsmasters_nav_menu_dropdown' );
- defaultElements.$cmsmasters_dropdown_button = $cmsmasters_dropdown_button;
- defaultElements.$cmsmasters_dropdown_container = $cmsmasters_dropdown_container;
- return defaultElements;
- },
- bindEvents() {
- this.elements.$cmsmasters_dropdown_button.on( 'click', this.onButtonClick.bind( this ) );
- },
- onButtonClick( event ) {
- event.preventDefault();
- this.elements.$cmsmasters_dropdown_button.addClass("active");
- this.elements.$cmsmasters_dropdown_container.addClass("active");
- },
- });
- module.exports = function ($scope) {
- new MenuWidget({ $element: $scope });
- };
- /***/ }),
- /***/ 1:
- /*!******************************!*\
- !*** multi ./js/frontend.js ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(/*! W:\domains\mihalich-themes.net\wp-content\plugins\cmsmasters-elementor-widgets\js\frontend.js */"./js/frontend.js");
- /***/ })
- /******/ });
- //# sourceMappingURL=frontend.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement