PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.18
UiCore Elements – Free widgets and templates for Elementor v1.3.18
1.3.18 1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 All 42 releases
← All changes | assets/js/components/global-counter.js +1 -1 1.2.3 → 1.3.18 View file →
@@ -1 +1 @@
1 -"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(n){var r=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(n);return _possibleConstructorReturn(this,r?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}window.addEventListener("DOMContentLoaded",function(){var t=function(){_inherits(t,elementorModules.frontend.handlers.Base);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.apply(this,arguments)}return _createClass(t,[{key:"sanitizeText",value:function(e){return void 0!==e&&""!==e&&e.replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"}[e]})}},{key:"updateCounter",value:function(){var t,e,n=this,r=this.getElementSettings("counter_animation"),o=this.$element.find(".ui-e-num span.value");"motion"==r?(t=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(jQuery(n.$element).addClass("ui-e-active"),t.unobserve(e.target))})},{threshold:.1})).observe(this.$element[0]):(o.text(this.getElementSettings("count_start")),e={startVal:parseFloat(this.getElementSettings("count_start"))||0,decimalPlaces:parseInt(this.getElementSettings("decimal_places"))||0,useGrouping:"true"===this.getElementSettings("use_grouping"),separator:this.sanitizeText(this.getElementSettings("counter_separator"))||"",decimal:this.sanitizeText(this.getElementSettings("decimal_symbol"))||",",duration:parseFloat(this.getElementSettings("duration"))||2,enableScrollSpy:!0,scrollSpyOnce:!0,scrollSpyDelay:0},"odometer"==r&&(r=window.Odometer||{},e=_objectSpread(_objectSpread({},e),{},{plugin:new r({duration:this.getElementSettings("duration")/2,lastDigitDelay:0})}),"true"==this.getElementSettings("animate_suffix"))&&(e=_objectSpread(_objectSpread({},e),{},{suffix:this.getElementSettings("counter_suffix")||""})),new countUp.CountUp(o[0],this.getElementSettings("count_end"),e))}},{key:"bindEvents",value:function(){this.updateCounter()}},{key:"onElementChange",value:function(e){["count_number","counter_html_tag","counter_animation","use_grouping","decimal_symbol","counter_separator","decimal_places","duration","counter_suffix"].includes(e)&&jQuery(this.$element).removeClass("ui-e-active")}}]),t}();jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/uicore-counter.default",function(e){elementorFrontend.elementsHandler.addHandler(t,{$element:e})})})});
1 +"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&("object"==_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}window.addEventListener("DOMContentLoaded",function(){var t=function(){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,elementorModules.frontend.handlers.Base),_createClass(e,[{key:"sanitizeText",value:function(e){return void 0!==e&&""!==e&&e.replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"}[e]})}},{key:"updateCounter",value:function(){var t,e,n=this,r=this.getElementSettings("counter_animation"),o=this.$element.find(".ui-e-num span.value");"motion"==r?(t=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(jQuery(n.$element).addClass("ui-e-active"),t.unobserve(e.target))})},{threshold:.1})).observe(this.$element[0]):(o.text(this.getElementSettings("count_start")),e={startVal:parseFloat(this.getElementSettings("count_start"))||0,decimalPlaces:parseInt(this.getElementSettings("decimal_places"))||0,useGrouping:"true"===this.getElementSettings("use_grouping"),separator:this.sanitizeText(this.getElementSettings("counter_separator"))||"",decimal:this.sanitizeText(this.getElementSettings("decimal_symbol"))||",",duration:parseFloat(this.getElementSettings("duration"))||2,enableScrollSpy:!0,scrollSpyOnce:!0,scrollSpyDelay:0},"odometer"==r&&(r=window.Odometer||{},e=_objectSpread(_objectSpread({},e),{},{plugin:new r({duration:this.getElementSettings("duration")/2,lastDigitDelay:0})}),"true"==this.getElementSettings("animate_suffix"))&&(e=_objectSpread(_objectSpread({},e),{},{suffix:this.getElementSettings("counter_suffix")||""})),new countUp.CountUp(o[0],this.getElementSettings("count_end"),e))}},{key:"bindEvents",value:function(){this.updateCounter()}},{key:"onElementChange",value:function(e){["count_number","counter_html_tag","counter_animation","use_grouping","decimal_symbol","counter_separator","decimal_places","duration","counter_suffix"].includes(e)&&jQuery(this.$element).removeClass("ui-e-active")}}])}();jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/uicore-counter.default",function(e){elementorFrontend.elementsHandler.addHandler(t,{$element:e})})})});