PageSourceSearch

https://www.devolo.ch/theme/861242e77cc817e81e9bc9a41913a7f1/js/cm…ms-kit.listing-view-toggle.plugin.b05b6a.js

js devolo.ch collected 2026-10-07 17:13:08 UTC 1,336 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkcms_kit=self.webpackChunkcms_kit||[]).push([[30503],{503(t,s,e){e.r(s),e.d(s,{default:()=>i});class i extends window.PluginBaseClass{static #t=this.options={storageKey:"listing-view-mode",listViewClass:"list-view"};init(){this._cmsElement=this.el.closest(".cms-element-product-listing"),this._cmsElement&&(this._buttons=Array.from(this.el.querySelectorAll("[data-listing-view-toggle-mode]")),0!==this._buttons.length&&(this._applyStoredState(),this._updateAttributes(),this._buttons.forEach(t=>{t.addEventListener("click",s=>{s.preventDefault();let e=t.dataset.listingViewToggleMode;this._setMode(e)})})))}_setMode(t){let s="list"===t;this._cmsElement.classList.toggle(this.options.listViewClass,s),this._storeState(s),this._updateAttributes()}_isListView(){return this._cmsElement.classList.contains(this.options.listViewClass)}_updateAttributes(){let t=this._isListView();this._buttons.forEach(s=>{let e=s.dataset.listingViewToggleMode,i="list"===e&&t||"grid"===e&&!t;s.setAttribute("aria-pressed",String(i)),s.classList.toggle("is-active",i)})}_applyStoredState(){try{!0===JSON.parse(localStorage.getItem(this.options.storageKey))&&this._cmsElement.classList.add(this.options.listViewClass)}catch(t){}}_storeState(t){try{localStorage.setItem(this.options.storageKey,JSON.stringify(t))}catch(t){}}}}}]);

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.