Advertisement
Konark

Untitled

Sep 2nd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/    // The module cache
  3. /******/    var installedModules = {};
  4. /******/
  5. /******/    // The require function
  6. /******/    function __webpack_require__(moduleId) {
  7. /******/
  8. /******/        // Check if module is in cache
  9. /******/        if(installedModules[moduleId]) {
  10. /******/            return installedModules[moduleId].exports;
  11. /******/        }
  12. /******/        // Create a new module (and put it into the cache)
  13. /******/        var module = installedModules[moduleId] = {
  14. /******/            i: moduleId,
  15. /******/            l: false,
  16. /******/            exports: {}
  17. /******/        };
  18. /******/
  19. /******/        // Execute the module function
  20. /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/        // Flag the module as loaded
  23. /******/        module.l = true;
  24. /******/
  25. /******/        // Return the exports of the module
  26. /******/        return module.exports;
  27. /******/    }
  28. /******/
  29. /******/
  30. /******/    // expose the modules object (__webpack_modules__)
  31. /******/    __webpack_require__.m = modules;
  32. /******/
  33. /******/    // expose the module cache
  34. /******/    __webpack_require__.c = installedModules;
  35. /******/
  36. /******/    // define getter function for harmony exports
  37. /******/    __webpack_require__.d = function(exports, name, getter) {
  38. /******/        if(!__webpack_require__.o(exports, name)) {
  39. /******/            Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/        }
  41. /******/    };
  42. /******/
  43. /******/    // define __esModule on exports
  44. /******/    __webpack_require__.r = function(exports) {
  45. /******/        if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/            Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/        }
  48. /******/        Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/    };
  50. /******/
  51. /******/    // create a fake namespace object
  52. /******/    // mode & 1: value is a module id, require it
  53. /******/    // mode & 2: merge all properties of value into the ns
  54. /******/    // mode & 4: return value when already ns object
  55. /******/    // mode & 8|1: behave like require
  56. /******/    __webpack_require__.t = function(value, mode) {
  57. /******/        if(mode & 1) value = __webpack_require__(value);
  58. /******/        if(mode & 8) return value;
  59. /******/        if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/        var ns = Object.create(null);
  61. /******/        __webpack_require__.r(ns);
  62. /******/        Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/        if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/        return ns;
  65. /******/    };
  66. /******/
  67. /******/    // getDefaultExport function for compatibility with non-harmony modules
  68. /******/    __webpack_require__.n = function(module) {
  69. /******/        var getter = module && module.__esModule ?
  70. /******/            function getDefault() { return module['default']; } :
  71. /******/            function getModuleExports() { return module; };
  72. /******/        __webpack_require__.d(getter, 'a', getter);
  73. /******/        return getter;
  74. /******/    };
  75. /******/
  76. /******/    // Object.prototype.hasOwnProperty.call
  77. /******/    __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/    // __webpack_public_path__
  80. /******/    __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/    // Load entry module and return exports
  84. /******/    return __webpack_require__(__webpack_require__.s = 1);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88.  
  89. /***/ "./js/frontend.js":
  90. /*!************************!*\
  91.   !*** ./js/frontend.js ***!
  92.   \************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports, __webpack_require__) {
  95.  
  96. var CmsmastersFrontend = function CmsmastersFrontend() {
  97.   var _this = this,
  98.       initOnReadyComponents = function initOnReadyComponents() {
  99.     _this.widgetsHandler = {
  100.       // Testimonials Grid
  101.       'cmsmasters-testimonials-grid.default': __webpack_require__(/*! ./widgets/testimonials-grid.js */ "./js/widgets/testimonials-grid.js"),
  102.       // Testimonials Slider
  103.       'cmsmasters-testimonials-slider.default': __webpack_require__(/*! ./widgets/testimonials-slider.js */ "./js/widgets/testimonials-slider.js"),
  104.       // Tab
  105.       'cmsmasters-tabs.default': __webpack_require__(/*! ./widgets/tabs.js */ "./js/widgets/tabs.js"),
  106.       // Toggles
  107.       'cmsmasters-toggles.default': __webpack_require__(/*! ./widgets/toggles.js */ "./js/widgets/toggles.js"),
  108.      
  109.       'cmsmasters-menu..default': __webpack_require__(/*! ./widgets/search.js */ "./js/widgets/search.js"),
  110.  
  111.       'cmsmasters-menu.default': __webpack_require__(/*! ./widgets/search.js */ "./js/widgets/menu.js")
  112.     };
  113.   },
  114.       addElementsHandlers = function addElementsHandlers() {
  115.     jQuery.each(_this.widgetsHandler, function (widgetName, widgetObject) {
  116.       elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, widgetObject);
  117.     });
  118.   };
  119.  
  120.   this.init = function () {
  121.     initOnReadyComponents();
  122.     addElementsHandlers();
  123.   };
  124. };
  125.  
  126. window.cmsmastersFrontend = new CmsmastersFrontend();
  127. jQuery(window).on('elementor/frontend/init', function () {
  128.   cmsmastersFrontend.init();
  129. });
  130.  
  131. /***/ }),
  132.  
  133. /***/ "./js/modules/image-carousel-base.js":
  134. /*!*******************************************!*\
  135.   !*** ./js/modules/image-carousel-base.js ***!
  136.   \*******************************************/
  137. /*! no static exports found */
  138. /***/ (function(module, exports) {
  139.  
  140. module.exports = elementorFrontend.Module.extend({
  141.   // Get Default Settings Function
  142.   getDefaultSettings: function getDefaultSettings() {
  143.     return {
  144.       selectors: {
  145.         mainSwiper: '.cmsmasters_testimonials_cont',
  146.         swiperSlide: '.swiper-slide'
  147.       },
  148.       slidesPerView: {
  149.         desktop: 3,
  150.         tablet: 2,
  151.         mobile: 1
  152.       }
  153.     };
  154.   },
  155.   // Get Default Elements Function
  156.   getDefaultElements: function getDefaultElements() {
  157.     var selectors = this.getSettings('selectors'),
  158.         elements = {
  159.       $mainSwiper: this.$element.find(selectors.mainSwiper)
  160.     };
  161.     elements.$mainSwiperSlides = elements.$mainSwiper.find(selectors.swiperSlide);
  162.     return elements;
  163.   },
  164.   getSlidesCount: function getSlidesCount() {
  165.     return this.elements.$mainSwiperSlides.length;
  166.   },
  167.   // Get Slides Per View Function
  168.   getDeviceSlidesPerView: function getDeviceSlidesPerView(device) {
  169.     var slidesPerViewKey = 'slides_per_view' + ('desktop' === device ? '' : '_' + device);
  170.     return Math.min(this.getSlidesCount(), +this.getElementSettings(slidesPerViewKey) || this.getSettings('slidesPerView')[device]);
  171.   },
  172.   getSlidesPerView: function getSlidesPerView(device) {
  173.     return this.getDeviceSlidesPerView(device);
  174.   },
  175.   getDesktopSlidesPerView: function getDesktopSlidesPerView() {
  176.     return this.getSlidesPerView('desktop');
  177.   },
  178.   getTabletSlidesPerView: function getTabletSlidesPerView() {
  179.     return this.getSlidesPerView('tablet');
  180.   },
  181.   getMobileSlidesPerView: function getMobileSlidesPerView() {
  182.     return this.getSlidesPerView('mobile');
  183.   },
  184.   // Get Slides To Scroll Function
  185.   getDeviceSlidesToScroll: function getDeviceSlidesToScroll(device) {
  186.     var slidesToScrollKey = 'slides_per_view' + ('desktop' === device ? '' : '_' + device);
  187.     return Math.min(this.getSlidesCount(), +this.getElementSettings(slidesToScrollKey) || 1);
  188.   },
  189.   getSlidesToScroll: function getSlidesToScroll(device) {
  190.     return this.getDeviceSlidesToScroll(device);
  191.   },
  192.   getDesktopSlidesToScroll: function getDesktopSlidesToScroll() {
  193.     return this.getSlidesToScroll('desktop');
  194.   },
  195.   getTabletSlidesToScroll: function getTabletSlidesToScroll() {
  196.     return this.getSlidesToScroll('tablet');
  197.   },
  198.   getMobileSlidesToScroll: function getMobileSlidesToScroll() {
  199.     return this.getSlidesToScroll('mobile');
  200.   },
  201.   // Get Swiper Options Value
  202.   getInitialSlide: function getInitialSlide() {
  203.     var editSettings = this.getEditSettings();
  204.     return editSettings.activeItemIndex ? editSettings.activeItemIndex - 1 : 0;
  205.   },
  206.   getNavigation: function getNavigation(type) {
  207.     if (this.getSlidesCount() > this.getElementSettings('slides_per_view')) {
  208.       if (type === 'arrows') {
  209.         return {
  210.           prevEl: '.cmsmasters_arrow_button_prev',
  211.           nextEl: '.cmsmasters_arrow_button_next'
  212.         };
  213.       } else if (type === 'pagination') {
  214.         return {
  215.           el: '.cmsmasters_pagination',
  216.           type: 'bullets',
  217.           clickable: true
  218.         };
  219.       }
  220.     } else {
  221.       return false;
  222.     }
  223.   },
  224.   // Get Swiper Options Function
  225.   getSwiperOptions: function getSwiperOptions() {
  226.     var elementSettings = this.getElementSettings(),
  227.         breakpointsSettings = {},
  228.         breakpoints = elementorFrontend.config.breakpoints;
  229.     breakpointsSettings[breakpoints.lg - 1] = {
  230.       slidesPerView: this.getTabletSlidesPerView(),
  231.       slidesPerGroup: this.getTabletSlidesToScroll()
  232.     };
  233.     breakpointsSettings[breakpoints.md - 1] = {
  234.       slidesPerView: this.getMobileSlidesPerView(),
  235.       slidesPerGroup: this.getMobileSlidesToScroll()
  236.     };
  237.     var swiperOptions = {
  238.       navigation: this.getNavigation('arrows'),
  239.       pagination: this.getNavigation('pagination'),
  240.       grabCursor: true,
  241.       slideToClickedSlide: true,
  242.       initialSlide: this.getInitialSlide(),
  243.       slidesPerView: this.getDesktopSlidesPerView(),
  244.       slidesPerGroup: this.getDesktopSlidesToScroll(),
  245.       loop: 'yes' === elementSettings.loop,
  246.       speed: elementSettings.speed,
  247.       breakpoints: breakpointsSettings
  248.     };
  249.  
  250.     if (!this.isEdit && elementSettings.autoplay) {
  251.       swiperOptions.autoplay = {
  252.         delay: elementSettings.autoplay_speed,
  253.         disableOnInteraction: !!elementSettings.pause_on_interaction
  254.       };
  255.     }
  256.  
  257.     return swiperOptions;
  258.   },
  259.   // Get Change Function
  260.   onElementChange: function onElementChange(propertyName) {
  261.     if (1 >= this.getSlidesCount()) {
  262.       return;
  263.     }
  264.  
  265.     if (0 === propertyName.indexOf('width')) {
  266.       this.swipers.main.update();
  267.     }
  268.   },
  269.   onEditSettingsChange: function onEditSettingsChange(propertyName) {
  270.     if (1 >= this.getSlidesCount()) {
  271.       return;
  272.     }
  273.  
  274.     if ('activeItemIndex' === propertyName) {
  275.       this.swipers.main.slideToLoop(this.getEditSettings('activeItemIndex') - 1);
  276.     }
  277.   },
  278.   // Get onInit Function
  279.   onInit: function onInit() {
  280.     elementorFrontend.Module.prototype.onInit.apply(this, arguments);
  281.     this.swipers = {};
  282.  
  283.     if (1 >= this.getSlidesCount()) {
  284.       return;
  285.     }
  286.  
  287.     this.swipers.main = new Swiper(this.elements.$mainSwiper, this.getSwiperOptions());
  288.   }
  289. });
  290.  
  291. /***/ }),
  292.  
  293. /***/ "./js/modules/tabs-base.js":
  294. /*!*********************************!*\
  295.   !*** ./js/modules/tabs-base.js ***!
  296.   \*********************************/
  297. /*! no static exports found */
  298. /***/ (function(module, exports) {
  299.  
  300. module.exports = elementorFrontend.Module.extend({
  301.   $activeContent: null,
  302.   // Get Default Settings Function
  303.   getDefaultSettings: function getDefaultSettings() {
  304.     return {
  305.       selectors: {
  306.         tabTitle: null,
  307.         tabContent: null
  308.       },
  309.       classes: {
  310.         active_tab: null
  311.       },
  312.       showTabFn: 'show',
  313.       hideTabFn: 'hide',
  314.       toggleSelf: true,
  315.       hidePrevious: true,
  316.       autoExpand: true
  317.     };
  318.   },
  319.   // Get Default Elements Function
  320.   getDefaultElements: function getDefaultElements() {
  321.     var selectors = this.getSettings('selectors');
  322.     return {
  323.       $tabTitles: this.findElement(selectors.tabTitle),
  324.       $tabContents: this.findElement(selectors.tabContent)
  325.     };
  326.   },
  327.   activateDefaultTab: function activateDefaultTab() {
  328.     var settings = this.getSettings();
  329.  
  330.     if (!settings.autoExpand || 'editor' === settings.autoExpand && !this.isEdit) {
  331.       return;
  332.     }
  333.  
  334.     var defaultActiveTab = this.getEditSettings('activeItemIndex') || 1,
  335.         originalToggleMethods = {
  336.       showTabFn: settings.showTabFn,
  337.       hideTabFn: settings.hideTabFn
  338.     }; // Toggle tabs without animation to avoid jumping
  339.  
  340.     this.setSettings({
  341.       showTabFn: 'show',
  342.       hideTabFn: 'hide'
  343.     });
  344.     this.changeActiveTab(defaultActiveTab); // Return back original toggle effects
  345.  
  346.     this.setSettings(originalToggleMethods);
  347.   },
  348.   deactivateActiveTab: function deactivateActiveTab(tabIndex) {
  349.     var settings = this.getSettings(),
  350.         activeClass = settings.classes.active_tab,
  351.         activeFilter = tabIndex ? '[data-tab="' + tabIndex + '"]' : '.' + activeClass,
  352.         $activeTitle = this.elements.$tabTitles.filter(activeFilter),
  353.         $activeContent = this.elements.$tabContents.filter(activeFilter);
  354.     $activeTitle.add($activeContent).removeClass(activeClass);
  355.     $activeContent[settings.hideTabFn]();
  356.   },
  357.   activateTab: function activateTab(tabIndex) {
  358.     var settings = this.getSettings(),
  359.         activeClass = settings.classes.active_tab,
  360.         $requestedTitle = this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]'),
  361.         $requestedContent = this.elements.$tabContents.filter('[data-tab="' + tabIndex + '"]');
  362.     $requestedTitle.add($requestedContent).addClass(activeClass);
  363.     $requestedContent[settings.showTabFn]();
  364.   },
  365.   isActiveTab: function isActiveTab(tabIndex) {
  366.     return this.elements.$tabTitles.filter('[data-tab="' + tabIndex + '"]').hasClass(this.getSettings('classes.active_tab'));
  367.   },
  368.   bindEvents: function bindEvents() {
  369.     var _this = this;
  370.  
  371.     this.elements.$tabTitles.on({
  372.       keydown: function keydown(event) {
  373.         if ('Enter' === event.key) {
  374.           event.preventDefault();
  375.  
  376.           _this.changeActiveTab(event.currentTarget.dataset.tab);
  377.         }
  378.       },
  379.       click: function click(event) {
  380.         event.preventDefault();
  381.  
  382.         _this.changeActiveTab(event.currentTarget.dataset.tab);
  383.       }
  384.     });
  385.   },
  386.   onInit: function onInit() {
  387.     elementorModules.frontend.handlers.Base.prototype.onInit.apply(this, arguments);
  388.     this.activateDefaultTab();
  389.   },
  390.   onEditSettingsChange: function onEditSettingsChange(propertyName) {
  391.     if ('activeItemIndex' === propertyName) {
  392.       this.activateDefaultTab();
  393.     }
  394.   },
  395.   changeActiveTab: function changeActiveTab(tabIndex) {
  396.     var isActiveTab = this.isActiveTab(tabIndex),
  397.         settings = this.getSettings();
  398.  
  399.     if ((settings.toggleSelf || !isActiveTab) && settings.hidePrevious) {
  400.       this.deactivateActiveTab();
  401.     }
  402.  
  403.     if (!settings.hidePrevious && isActiveTab) {
  404.       this.deactivateActiveTab(tabIndex);
  405.     }
  406.  
  407.     if (!isActiveTab) {
  408.       this.activateTab(tabIndex);
  409.     }
  410.   }
  411. });
  412.  
  413. /***/ }),
  414.  
  415. /***/ "./js/widgets/tabs.js":
  416. /*!****************************!*\
  417.   !*** ./js/widgets/tabs.js ***!
  418.   \****************************/
  419. /*! no static exports found */
  420. /***/ (function(module, exports, __webpack_require__) {
  421.  
  422. var Base = __webpack_require__(/*! ../modules/tabs-base */ "./js/modules/tabs-base.js"),
  423.     Tabs;
  424.  
  425. Tabs = Base.extend({
  426.   getDefaultSettings: function getDefaultSettings() {
  427.     var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments);
  428.     defaultSettings.selectors = {
  429.       tabTitle: '.cmsmasters_tabs_list_item',
  430.       tabContent: '.cmsmasters_tab'
  431.     };
  432.     defaultSettings.classes = {
  433.       active_tab: 'active_tab'
  434.     };
  435.     defaultSettings.toggleSelf = false;
  436.     return defaultSettings;
  437.   },
  438.   onInit: function onInit() {
  439.     Base.prototype.onInit.apply(this, arguments);
  440.   }
  441. });
  442.  
  443. module.exports = function ($scope) {
  444.   new Tabs({
  445.     $element: $scope
  446.   });
  447. };
  448.  
  449. /***/ }),
  450.  
  451. /***/ "./js/widgets/testimonials-grid.js":
  452. /*!*****************************************!*\
  453.   !*** ./js/widgets/testimonials-grid.js ***!
  454.   \*****************************************/
  455. /*! no static exports found */
  456. /***/ (function(module, exports, __webpack_require__) {
  457.  
  458. var Icon = __webpack_require__(/*! ./testimonials-icon */ "./js/widgets/testimonials-icon.js"),
  459.     TestimonialsGrid = elementorFrontend.Module.extend({
  460.   getDefaultElements: function getDefaultElements() {
  461.     var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
  462.         $testimonials_icon_main = this.findElement('.cmsmasters_testimonials_icon_main'),
  463.         $testimonials_icon_additional = this.findElement('.cmsmasters_testimonials_icon_additional'),
  464.         $testimonials_container = this.findElement('.cmsmasters_testimonials_grid');
  465.     defaultElements.$testimonials_icon_main = $testimonials_icon_main;
  466.     defaultElements.$testimonials_icon_additional = $testimonials_icon_additional;
  467.     defaultElements.$testimonials_container = $testimonials_container;
  468.     return defaultElements;
  469.   },
  470.   initIcon: function initIcon() {
  471.     if (this.isEdit) {
  472.       new Icon({
  473.         widget: this,
  474.         $TestimonialsIconMain: this.elements.$testimonials_icon_main,
  475.         $TestimonialsIconAdditional: this.elements.$testimonials_icon_additional,
  476.         $TestimonialsContainer: this.elements.$testimonials_container,
  477.         mainControlsName: {
  478.           y: 'testimonials_item_icon_position_y',
  479.           x: 'testimonials_item_icon_position_x'
  480.         },
  481.         additionalControlsName: {
  482.           y: 'testimonials_item_icon_additional_position_y',
  483.           x: 'testimonials_item_icon_additional_position_x'
  484.         }
  485.       });
  486.     }
  487.   },
  488.   onInit: function onInit() {
  489.     elementorFrontend.Module.prototype.onInit.apply(this, arguments);
  490.     this.initIcon();
  491.   }
  492. });
  493.  
  494. module.exports = function ($scope) {
  495.   new TestimonialsGrid({
  496.     $element: $scope
  497.   });
  498. };
  499.  
  500. /***/ }),
  501.  
  502. /***/ "./js/widgets/testimonials-icon.js":
  503. /*!*****************************************!*\
  504.   !*** ./js/widgets/testimonials-icon.js ***!
  505.   \*****************************************/
  506. /*! no static exports found */
  507. /***/ (function(module, exports) {
  508.  
  509. var TestimonialsSliderIcons = elementorModules.ViewModule.extend({
  510.   getDefaultSettings: function getDefaultSettings() {
  511.     return {
  512.       selectors: {
  513.         $TestimonialsIconMain: null,
  514.         $TestimonialsIconAdditional: null,
  515.         $TestimonialsContainer: null
  516.       }
  517.     };
  518.   },
  519.   getDefaultElements: function getDefaultElements() {
  520.     var _this$getSettings = this.getSettings(),
  521.         $TestimonialsIconMain = _this$getSettings.$TestimonialsIconMain,
  522.         $TestimonialsIconAdditional = _this$getSettings.$TestimonialsIconAdditional,
  523.         $TestimonialsContainer = _this$getSettings.$TestimonialsContainer;
  524.  
  525.     return {
  526.       $TestimonialsIconMain: $TestimonialsIconMain,
  527.       $TestimonialsIconAdditional: $TestimonialsIconAdditional,
  528.       $TestimonialsContainer: $TestimonialsContainer
  529.     };
  530.   },
  531.   isEditable: function isEditable() {
  532.     var _this$getSettings2 = this.getSettings(),
  533.         widget = _this$getSettings2.widget;
  534.  
  535.     return widget.$element.hasClass('elementor-element-editable');
  536.   },
  537.   returnStopDefaultEvent: function returnStopDefaultEvent(event) {
  538.     if (this.isEditable()) return this.stopDefaultEvent(event);
  539.     return true;
  540.   },
  541.   initDraggable: function initDraggable() {
  542.     this.elements.$TestimonialsIconMain.on('mousedown', this.returnStopDefaultEvent).draggable({
  543.       iframeFix: true,
  544.       containment: "parent",
  545.       create: function create(event, ui) {
  546.         jQuery('.cmsmasters_testimonials_icon_main').css({
  547.           cursor: "grab"
  548.         });
  549.       },
  550.       start: function start(event, ui) {
  551.         jQuery('.cmsmasters_testimonials_icon_main').css({
  552.           cursor: "grabbing"
  553.         });
  554.       },
  555.       drag: this.handleDraggableDragMain.bind(this),
  556.       stop: this.handleDraggableEndMain.bind(this)
  557.     });
  558.     this.elements.$TestimonialsIconAdditional.on('mousedown', this.returnStopDefaultEvent).draggable({
  559.       iframeFix: true,
  560.       containment: "parent",
  561.       create: function create(event, ui) {
  562.         jQuery('.cmsmasters_testimonials_icon_additional').css({
  563.           cursor: "grab"
  564.         });
  565.       },
  566.       start: function start(event, ui) {
  567.         jQuery('.cmsmasters_testimonials_icon_additional').css({
  568.           cursor: "grabbing"
  569.         });
  570.       },
  571.       drag: this.handleDraggableDragAdditional.bind(this),
  572.       stop: this.handleDraggableEndAdditional.bind(this)
  573.     });
  574.   },
  575.   handleDraggableDragMain: function handleDraggableDragMain(event, ui) {
  576.     var helper = ui.helper,
  577.         position = ui.position;
  578.     this.elements.$TestimonialsIconMain.not(helper).css({
  579.       top: position.top,
  580.       left: position.left
  581.     });
  582.   },
  583.   handleDraggableDragAdditional: function handleDraggableDragAdditional(event, ui) {
  584.     var helper = ui.helper,
  585.         position = ui.position;
  586.     this.elements.$TestimonialsIconAdditional.not(helper).css({
  587.       top: position.top,
  588.       left: position.left
  589.     });
  590.   },
  591.   handleDraggableEndMain: function handleDraggableEndMain(event, ui) {
  592.     var $TestimonialsIconMain = ui.helper,
  593.         position = ui.position,
  594.         positionPercent = this.getPositionsPrecent(position.top, position.left);
  595.  
  596.     if (positionPercent.top > 100 || positionPercent.left > 100) {
  597.       positionPercent = this.getPositionsPrecent(position.top, position.left);
  598.       debugger;
  599.     }
  600.  
  601.     this.savePositionsMain(positionPercent);
  602.     $TestimonialsIconMain.css({
  603.       top: positionPercent.topP,
  604.       left: positionPercent.leftP,
  605.       cursor: "grab"
  606.     });
  607.   },
  608.   handleDraggableEndAdditional: function handleDraggableEndAdditional(event, ui) {
  609.     var $TestimonialsIconAdditional = ui.helper,
  610.         position = ui.position,
  611.         positionPercent = this.getPositionsPrecent(position.top, position.left);
  612.  
  613.     if (positionPercent.top > 100 || positionPercent.left > 100) {
  614.       positionPercent = this.getPositionsPrecent(position.top, position.left);
  615.       debugger;
  616.     }
  617.  
  618.     this.savePositionsAdditional(positionPercent);
  619.     $TestimonialsIconAdditional.css({
  620.       top: positionPercent.topP,
  621.       left: positionPercent.leftP,
  622.       cursor: "grab"
  623.     });
  624.   },
  625.   savePositionsMain: function savePositionsMain(positions) {
  626.     var _this$getSettings3 = this.getSettings(),
  627.         widget = _this$getSettings3.widget,
  628.         mainControlsName = _this$getSettings3.mainControlsName,
  629.         modelCID = widget.getModelCID(),
  630.         model = elementorFrontend.config.elements.data[modelCID];
  631.  
  632.     model.attributes[mainControlsName.y] = positions.top;
  633.     model.attributes[mainControlsName.x] = positions.left;
  634.     elementorFrontend.config.elements.data[modelCID] = model;
  635.     elementor.saver.setFlagEditorChange(true);
  636.   },
  637.   savePositionsAdditional: function savePositionsAdditional(positions) {
  638.     var _this$getSettings4 = this.getSettings(),
  639.         widget = _this$getSettings4.widget,
  640.         additionalControlsName = _this$getSettings4.additionalControlsName,
  641.         modelCID = widget.getModelCID(),
  642.         model = elementorFrontend.config.elements.data[modelCID];
  643.  
  644.     model.attributes[additionalControlsName.y] = positions.top;
  645.     model.attributes[additionalControlsName.x] = positions.left;
  646.     elementorFrontend.config.elements.data[modelCID] = model;
  647.     elementor.saver.setFlagEditorChange(true);
  648.   },
  649.   getPositionsPrecent: function getPositionsPrecent(topArr, leftArr) {
  650.     var top = this.getTopPrecent(topArr),
  651.         left = this.getLeftPrecent(leftArr);
  652.     return {
  653.       top: top,
  654.       left: left,
  655.       topP: top + '%',
  656.       leftP: left + '%'
  657.     };
  658.   },
  659.   getTopPrecent: function getTopPrecent(top) {
  660.     return this.toPercent(top, this.elements.$TestimonialsContainer.height());
  661.   },
  662.   getLeftPrecent: function getLeftPrecent(left) {
  663.     return this.toPercent(left, this.elements.$TestimonialsContainer.width());
  664.   },
  665.   toPercent: function toPercent() {
  666.     return Number((Math.min(arguments[0], arguments[1]) / Math.max(arguments[0], arguments[1]) * 100).toFixed(3));
  667.   },
  668.   stopDefaultEvent: function stopDefaultEvent(event) {
  669.     event.preventDefault();
  670.     event.stopPropagation();
  671.     return false;
  672.   },
  673.   onInit: function onInit() {
  674.     elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
  675.     this.initDraggable();
  676.   }
  677. });
  678. module.exports = TestimonialsSliderIcons;
  679.  
  680. /***/ }),
  681.  
  682. /***/ "./js/widgets/testimonials-slider.js":
  683. /*!*******************************************!*\
  684.   !*** ./js/widgets/testimonials-slider.js ***!
  685.   \*******************************************/
  686. /*! no static exports found */
  687. /***/ (function(module, exports, __webpack_require__) {
  688.  
  689. var Base = __webpack_require__(/*! ../modules/image-carousel-base */ "./js/modules/image-carousel-base.js"),
  690.     TestimonialsSlider,
  691.     Icon = __webpack_require__(/*! ./testimonials-icon */ "./js/widgets/testimonials-icon.js");
  692.  
  693. TestimonialsSlider = Base.extend({
  694.   getDefaultSettings: function getDefaultSettings() {
  695.     var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments);
  696.     return defaultSettings;
  697.   },
  698.   getDefaultElements: function getDefaultElements() {
  699.     var defaultElements = Base.prototype.getDefaultElements.apply(this, arguments),
  700.         $testimonials_icon_main = this.findElement('.cmsmasters_testimonials_icon_main'),
  701.         $testimonials_icon_additional = this.findElement('.cmsmasters_testimonials_icon_additional'),
  702.         $testimonials_container = this.findElement('.cmsmasters_testimonial_item');
  703.     defaultElements.$testimonials_icon_main = $testimonials_icon_main;
  704.     defaultElements.$testimonials_icon_additional = $testimonials_icon_additional;
  705.     defaultElements.$testimonials_container = $testimonials_container;
  706.     return defaultElements;
  707.   },
  708.   getSlidesPerView: function getSlidesPerView(device) {
  709.     return Base.prototype.getSlidesPerView.apply(this, arguments);
  710.   },
  711.   allowTouchMove: function allowTouchMove() {
  712.     if (!this.isEdit) {
  713.       return true;
  714.     }
  715.   },
  716.   getSwiperOptions: function getSwiperOptions() {
  717.     var options = Base.prototype.getSwiperOptions.apply(this, arguments),
  718.         slidesCount = this.getSlidesCount();
  719.     options.allowTouchMove = this.allowTouchMove();
  720.     options.loopedSlides = slidesCount;
  721.  
  722.     options.onSlideChangeEnd = function (swiper) {
  723.       if (loop) {
  724.         swiper.fixLoop();
  725.       }
  726.     };
  727.  
  728.     return options;
  729.   },
  730.   initIcon: function initIcon() {
  731.     if (this.isEdit) {
  732.       new Icon({
  733.         widget: this,
  734.         $TestimonialsIconMain: this.elements.$testimonials_icon_main,
  735.         $TestimonialsIconAdditional: this.elements.$testimonials_icon_additional,
  736.         $TestimonialsContainer: this.elements.$testimonials_container,
  737.         mainControlsName: {
  738.           y: 'testimonials_item_icon_position_y',
  739.           x: 'testimonials_item_icon_position_x'
  740.         },
  741.         additionalControlsName: {
  742.           y: 'testimonials_item_icon_additional_position_y',
  743.           x: 'testimonials_item_icon_additional_position_x'
  744.         }
  745.       });
  746.     }
  747.   },
  748.   onInit: function onInit() {
  749.     Base.prototype.onInit.apply(this, arguments);
  750.     this.initIcon();
  751.   }
  752. });
  753.  
  754. module.exports = function ($scope) {
  755.   new TestimonialsSlider({
  756.     $element: $scope
  757.   });
  758. };
  759.  
  760. /***/ }),
  761.  
  762. /***/ "./js/widgets/toggles.js":
  763. /*!*******************************!*\
  764.   !*** ./js/widgets/toggles.js ***!
  765.   \*******************************/
  766. /*! no static exports found */
  767. /***/ (function(module, exports, __webpack_require__) {
  768.  
  769. var Base = __webpack_require__(/*! ../modules/tabs-base */ "./js/modules/tabs-base.js"),
  770.     Tabs;
  771.  
  772. Tabs = Base.extend({
  773.   getDefaultSettings: function getDefaultSettings() {
  774.     var defaultSettings = Base.prototype.getDefaultSettings.apply(this, arguments),
  775.         elementSettings = this.getElementSettings();
  776.     defaultSettings.selectors = {
  777.       tabTitle: '.cmsmasters_toggle_title',
  778.       tabContent: '.cmsmasters_toggle'
  779.     };
  780.     defaultSettings.classes = {
  781.       active_tab: 'active_tab'
  782.     };
  783.     defaultSettings.showTabFn = 'slideDown';
  784.     defaultSettings.hideTabFn = 'slideUp';
  785.  
  786.     if (elementSettings.toggle_mode == 'toggle') {
  787.       defaultSettings.hidePrevious = false;
  788.     }
  789.  
  790.     return defaultSettings;
  791.   },
  792.   onInit: function onInit() {
  793.     Base.prototype.onInit.apply(this, arguments);
  794.   }
  795. });
  796.  
  797. module.exports = function ($scope) {
  798.   new Tabs({
  799.     $element: $scope
  800.   });
  801. };
  802.  
  803. /***/ }),
  804.  
  805. /***/ "./js/widgets/search.js":
  806. /*!****************************!*\
  807.   !*** ./js/widgets/search.js ***!
  808.   \****************************/
  809. /*! no static exports found */
  810. /***/ (function(module, exports) {
  811.  
  812.   const SearchWidget = elementorFrontend.Module.extend({
  813.     getDefaultElements() {
  814.       var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
  815.         $elementor_element = this.findElement ( '.elementor-widget-cmsmasters-search' ),
  816.         $cmsmasters_search = this.findElement( '.cmsmasters_search' ),
  817.         $cmsmasters_search_container = this.findElement( '.cmsmasters_search_popup' ),
  818.         $cmsmasters_search_field = this.findElement( '.cmsmasters_search_field' ),
  819.         $cmsmasters_close_button = this.findElement( '.cmsmasters_search_popup_close' ),
  820.         $cmsmasters_search_button = this.findElement( '.cmsmasters_search_popup_trigger' ),
  821.         $cmsmasters_search_button_slide = this.findElement( '.cmsmasters_search_slide_button' ),
  822.         $cmsmasters_search_slide_close = this.findElement( '.cmsmasters_search_slide_close' ),
  823.         $cmsmasters_search_slide_button_full = this.findElement( '.cmsmasters_search_button_slide_full' ),
  824.         $cmsmasters_search_slide_close_full = this.findElement( '.cmsmasters_search_slide_close_full' ),
  825.         $cmsmasters_search_container_slide = this.findElement( '.cmsmasters_search_form_container' );
  826.        
  827.       defaultElements.$elementor_element = $elementor_element;
  828.       defaultElements.$cmsmasters_search = $cmsmasters_search;
  829.       defaultElements.$cmsmasters_search_field = $cmsmasters_search_field;
  830.       defaultElements.$cmsmasters_search_container = $cmsmasters_search_container;
  831.       defaultElements.$cmsmasters_close_button = $cmsmasters_close_button;
  832.       defaultElements.$cmsmasters_search_button = $cmsmasters_search_button;
  833.       defaultElements.$cmsmasters_search_button_slide = $cmsmasters_search_button_slide;
  834.       defaultElements.$cmsmasters_search_slide_close = $cmsmasters_search_slide_close;
  835.       defaultElements.$cmsmasters_search_slide_button_full = $cmsmasters_search_slide_button_full;
  836.       defaultElements.$cmsmasters_search_slide_close_full = $cmsmasters_search_slide_close_full;
  837.       defaultElements.$cmsmasters_search_container_slide = $cmsmasters_search_container_slide;
  838.      
  839.           return defaultElements;
  840.     },
  841.    
  842.     bindEvents() {
  843.       this.elements.$cmsmasters_search_button.on( 'click', this.onButtonClick.bind( this ) );
  844.       this.elements.$cmsmasters_close_button.on( 'click', this.onButtonCloseClick.bind( this ) );
  845.  
  846.       if ( !this.elements.$cmsmasters_search_container.hasClass( "cmsmasters_overlay_not_close" ) ) {
  847.         this.elements.$cmsmasters_search_container.on( 'click', this.onContainerClick.bind( this ) );
  848.       }
  849.        
  850.       this.elements.$cmsmasters_search_slide_button_full.on( 'click', this.onButtonFullSlideClick.bind( this ) );
  851.       this.elements.$cmsmasters_search_slide_close_full.on( 'click', this.onButtonFullSlideClick.bind( this ) );
  852.      
  853.       this.elements.$cmsmasters_search_button_slide.on( 'click', this.onButtonMinimalSlideClick.bind( this ) );
  854.       this.elements.$cmsmasters_search_slide_close.on( 'click', this.onButtonMinimalSlideClick.bind( this ) );
  855.     },
  856.  
  857.     onButtonClick( event ) {
  858.       event.preventDefault();
  859.  
  860.       this.elements.$cmsmasters_search_container.addClass("cmsmasters_search_form_full_screen");
  861.  
  862.      
  863.       if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
  864.         document.getElementsByTagName("html")[0].style.overflow = 'hidden';
  865.       }
  866.     },
  867.  
  868.     onButtonCloseClick( event ) {
  869.       event.preventDefault();
  870.  
  871.       this.elements.$cmsmasters_search_container.removeClass("cmsmasters_search_form_full_screen");
  872.  
  873.       if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
  874.         document.getElementsByTagName("html")[0].style.overflow = 'inherit';
  875.       }
  876.     },
  877.  
  878.     onContainerClick( event ) {
  879.       event.preventDefault();
  880.  
  881.       if (this.elements.$cmsmasters_search_container.hasClass("cmsmasters_search_form_full_screen") && this.elements.$cmsmasters_search_container[0] === event.target) {
  882.         this.elements.$cmsmasters_search_container.removeClass("cmsmasters_search_form_full_screen");
  883.       }
  884.      
  885.       if ( this.elements.$cmsmasters_search_container.hasClass('cmsmasters_disabled_scroll') ) {
  886.         document.getElementsByTagName("html")[0].style.overflow = 'inherit';
  887.       }
  888.     },
  889.  
  890.     onButtonMinimalSlideClick( event ) {
  891.       event.preventDefault();
  892.  
  893.       this.elements.$cmsmasters_search_container_slide.toggleClass("active");
  894.     },
  895.  
  896.     onButtonFullSlideClick( event ) {
  897.       event.preventDefault();
  898.      
  899.       // For setTimeout
  900.       var $that = this,
  901.       $width = this.elements.$cmsmasters_search_container_slide.outerWidth(true),
  902.       $width_btn =  this.elements.$cmsmasters_search_slide_button_full.outerWidth(true);
  903.  
  904.  
  905.       if ( ! this.elements.$cmsmasters_search_container_slide.hasClass("active") ) {
  906.         this.elements.$cmsmasters_search_container_slide.css("left", "0");
  907.         this.elements.$cmsmasters_search_container_slide.addClass("cmsmasters_in");
  908.  
  909.                 setTimeout( function() {
  910.                     $that.elements.$cmsmasters_search_container_slide.removeClass("cmsmasters_in");
  911.           $that.elements.$cmsmasters_search_container_slide.addClass("active");
  912.         }, 300 );
  913.        
  914.         if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_button") ) {
  915.             var $pos = this.elements.$cmsmasters_search_slide_button_full.position();
  916.          
  917.             this.elements.$cmsmasters_search_container_slide.css("left", ($pos.left + $width_btn/2) - $width/2);
  918.  
  919.             var $leftcss_container = +this.elements.$cmsmasters_search_container_slide.css("left").replace('px', ''),
  920.             $container_postition = $leftcss_container + $width + this.elements.$cmsmasters_search.offset().left;
  921.        
  922.  
  923.             if( $container_postition > window.innerWidth ) {
  924.               this.elements.$cmsmasters_search_container_slide.css("left", ((($pos.left + $width_btn/2) - $width/2)) - ($container_postition - window.innerWidth) - 17);
  925.             } else if ( this.elements.$cmsmasters_search_container_slide.offset().left < 0 ) {
  926.               this.elements.$cmsmasters_search_container_slide.css("left", ((($pos.left + $width_btn/2) - $width/2)) - (this.elements.$cmsmasters_search_container_slide.offset().left / 2));
  927.             }
  928.          
  929.         } else if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_block") ) {
  930.           var $parent_id = this.elements.$cmsmasters_search_container_slide[0].attributes[0].value;
  931.           var $position_parent = document.querySelector('[data-id="' + $parent_id + '"]').getBoundingClientRect().top + pageYOffset,
  932.           $position_container = this.elements.$cmsmasters_search_container_slide.offset().top,
  933.           $cmsmasters_search_height = this.elements.$cmsmasters_search.outerHeight(true),
  934.           $height_container = this.elements.$cmsmasters_search_container_slide.outerHeight(true),
  935.           $height_parent = document.querySelector('[data-id="' + $parent_id + '"]').offsetHeight;
  936.  
  937.           setTimeout( function() {
  938.             alert('$position_parent' + $position_parent + '$position_container' + $position_container + '$height_parent' + $height_parent + '$height_container' + $height_container);
  939.           }, 300 );
  940.          
  941.           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));
  942.          
  943.         } else {
  944.           var $pos = this.elements.$cmsmasters_search.offset();
  945.          
  946.           if ( $pos.left < $width ) {
  947.             this.elements.$cmsmasters_search_container_slide.css("left", -$pos.left);
  948.           } else {
  949.             this.elements.$cmsmasters_search_container_slide.css("left", -($pos.left - $width/2));
  950.           }
  951.         }
  952.  
  953.                 this.elements.$cmsmasters_search_field.focus();
  954.             } else {
  955.                 this.elements.$cmsmasters_search_container_slide.removeClass("active");
  956.         this.elements.$cmsmasters_search_container_slide.addClass("cmsmasters_out");
  957.         this.elements.$cmsmasters_search_container_slide.css("left", "-999em");
  958.  
  959.         if ( this.elements.$cmsmasters_search_container_slide.hasClass("cmsmasters_form_relative_to_block") ) {
  960.           this.elements.$cmsmasters_search_container_slide.css("bottom", "auto");
  961.         }
  962.  
  963.                 setTimeout( function() {
  964.           $that.elements.$cmsmasters_search_container_slide.removeClass("cmsmasters_out");
  965.         }, 300 );
  966.             }
  967.     }
  968. });
  969.  
  970. module.exports = function ($scope) {
  971.   new SearchWidget({ $element: $scope });
  972. };
  973.  
  974. /***/ }),
  975.  
  976.  
  977. /***/ "./js/widgets/menu.js":
  978. /*!****************************!*\
  979.   !*** ./js/widgets/menu.js ***!
  980.   \****************************/
  981. /*! no static exports found */
  982. /***/ (function(module, exports) {
  983.  
  984.   const MenuWidget = elementorFrontend.Module.extend({
  985.     getDefaultElements() {
  986.       var defaultElements = elementorFrontend.Module.prototype.getDefaultElements.apply(this, arguments),
  987.         $cmsmasters_dropdown_button = this.findElement ( '.cmsmasters_nav_menu_toggle' ),
  988.         $cmsmasters_dropdown_container = this.findElement ( '.cmsmasters_nav_menu_dropdown' );
  989.        
  990.       defaultElements.$cmsmasters_dropdown_button = $cmsmasters_dropdown_button;
  991.       defaultElements.$cmsmasters_dropdown_container = $cmsmasters_dropdown_container;
  992.      
  993.  
  994.           return defaultElements;
  995.     },
  996.    
  997.     bindEvents() {
  998.       this.elements.$cmsmasters_dropdown_button.on( 'click', this.onButtonClick.bind( this ) );
  999.     },
  1000.  
  1001.     onButtonClick( event ) {
  1002.       event.preventDefault();
  1003.  
  1004.       this.elements.$cmsmasters_dropdown_button.addClass("active");
  1005.       this.elements.$cmsmasters_dropdown_container.addClass("active");
  1006.     },
  1007. });
  1008.  
  1009. module.exports = function ($scope) {
  1010.   new MenuWidget({ $element: $scope });
  1011. };
  1012.  
  1013. /***/ }),
  1014.  
  1015.  
  1016. /***/ 1:
  1017. /*!******************************!*\
  1018.   !*** multi ./js/frontend.js ***!
  1019.   \******************************/
  1020. /*! no static exports found */
  1021. /***/ (function(module, exports, __webpack_require__) {
  1022.  
  1023. module.exports = __webpack_require__(/*! W:\domains\mihalich-themes.net\wp-content\plugins\cmsmasters-elementor-widgets\js\frontend.js */"./js/frontend.js");
  1024.  
  1025.  
  1026. /***/ })
  1027.  
  1028. /******/ });
  1029. //# sourceMappingURL=frontend.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement