PluginProbe
Getwid – Gutenberg Blocks / 3.0.2
Getwid – Gutenberg Blocks v3.0.2
3.0.2 3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / assets / blocks / progress-bar / view.js

view.js in Getwid – Gutenberg Blocks 3.0.2, at assets/blocks/progress-bar/view.js

1 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var r=0;r<n.length;){var o=n[r++],i=n[r++];e.o(t,o)?0===i&&r++:0===i?Object.defineProperty(t,o,{enumerable:!0,value:n[r++]}):Object.defineProperty(t,o,{enumerable:!0,get:i})}else for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.jQuery;var n=e.n(t);const r=".wp-block-getwid-progress-bar";function o(e,t){e.find(`${r}__progress`).css("width",`${t}%`),e.find(`${r}__percent`).text(`${t}%`)}function i(){const e=window.Waypoint;"function"==typeof e&&n()(".wp-block-getwid-progress-bar:not(.getwid-init)").each((t,i)=>{const a=n()(i),d=a.find(`${r}__wrapper`),s=d.get(0),c=Number.parseInt(String(d.data("fill-amount")||"0"),10),f=Boolean(d.data("is-animated"));if(!s)return;a.addClass("getwid-init");const u=new e({element:s,handler:()=>{f?function(e,t){const n=e.find(`${r}__progress`);n.animate({width:`${t}%`},{duration:2e3,progress:()=>{const t=n.parent().width()||1,o=Math.round((n.width()||0)/t*100);e.find(`${r}__percent`).text(o+"%")}})}(a,c):o(a,c),u.destroy()},offset:"100%"});n()(window).on("resize",()=>{o(a,c)})})}n()(document).ready(()=>{n()(document.body).on("post-load",()=>{i()}),i()})})();