1import NiuBase from "niu-base"; 2 3class NiuFloatingCheckout extends NiuBase{ 4 static Selectors = { 5 wrapper:()=>{return'[data-niu-floating-checkout]'}, 6 checkout: '[data-niu-product-checkout]', 7 bottombar: '#copyright', 8 addToCart:'[data-niu-floating-checkout-addtocart]' 9 } 10 11 constructor(wrapper) { 12 super(wrapper); 13 this.checkout = false; 14 this.addToCartBtn = false; 15 } 16 17 init(){ 18 this.checkout = document.querySelector(NiuFloatingCheckout.Selectors.checkout); 19 this.bottombar = document.querySelector(NiuFloatingCheckout.Selectors.bottombar); 20 if(!this.checkout){ 21 console.warn('found no checkoutbtn'); 22 return; 23 } 24 25 26 27 dzm.dispatcher.observe(this.checkout,(isVisible)=>{ 28 this.wrapper.classList.toggle('show',!isVisible); 29 }); 30 dzm.dispatcher.observe(this.bottombar,(isVisible)=>{ 31 this.wrapper.classList.toggle('not',isVisible); 32 }); 33 super.init(); 34 } 35} 36 37 38NiuBase.listenTo([ 39 dzm.events.controller.initialized 40],()=>{ 41 NiuFloatingCheckout.Scan(); 42})
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.