1"use strict";(self.webpackChunkuniversity_of_glasgow=self.webpackChunkuniversity_of_glasgow||[]).push([[7811],{16742:function(t,e,s){s.r(e),s.d(e,{default:function(){return Multistepform}});var i=s(18987);class Multistepform{constructor(t,e){this.el=t,this.config=e,this.steps=this.getSteps(),console.log(this),this.initialize()}initialize(){this.insertButtons()}getSteps(){return[...this.el.querySelectorAll(".step")]}hideStep(t){t.classList.add("hidden")}showStep(t){t.classList.remove("hidden")}validateFields(t){let e=!0;return[...t.querySelectorAll(".check")].forEach((t=>{console.log(t.value),""===t.value?(e=!1,t.classList.add("validate")):t.classList.remove("validate")})),e}setCurrentStep(t){i.A.set("currentStep",t)}insertButtons(){this.steps.forEach(((t,e)=>{console.log(e+1),console.log(this.steps.length),e+1!==this.steps.length&&(t.insertAdjacentHTML("beforeend",`<button class="next-step" id="step-${e+1}-next" data-nextstep="${e+2}">next</button>`),this.clickHandler(t))}))}clickHandler(t){console.log(t);[...t.querySelectorAll(".next-step")].forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),this.validateFields(t)&&(console.log(e.target.dataset.nextstep),this.steps.forEach((t=>{e.target.dataset.nextstep===t.dataset.step?this.showStep(t):this.hideStep(t)})))}))}))}}}}]); 2//# sourceMappingURL=gu-multistepform.eb927364.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.