1/*1789699926000*/ 2/** 3 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 4 * 5 * This library is free software; you can redistribute it and/or modify it under 6 * the terms of the GNU Lesser General Public License as published by the Free 7 * Software Foundation; either version 2.1 of the License, or (at your option) 8 * any later version. 9 * 10 * This library is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 13 * details. 14 */ 15 16if (window.NodeList && !NodeList.prototype.forEach) { 17 NodeList.prototype.forEach = Array.prototype.forEach; 18} 19 20AUI().ready( 21 22 /* 23 This function gets loaded when all the HTML, not including the portlets, is 24 loaded. 25 */ 26 27 () => { 28 const searchBar = Liferay.component('search-bar'); 29 30 if (searchBar) { 31 searchBar.on('toggled', (status) => { 32 document.querySelectorAll('.js-toggle-search').forEach((el) => { 33 el.classList.toggle('is-active', status); 34 }); 35 36 document 37 .getElementById('minium') 38 .classList.toggle('has-search', status); 39 }); 40 41 // document.querySelectorAll(".js-toggle-search").forEach(el => { 42 // el.classList.toggle("is-active", searchBar.active); 43 // }); 44 45 } 46 47 try { 48 new Header(); 49 new Footer(); 50 new DateScroll(); 51 } catch (e) {} 52 } 53); 54 55Liferay.Portlet.ready( 56 57 /* 58 This function gets loaded after each and every portlet on the page. 59 60 portletId: the current portlet's id 61 node: the Alloy Node object of the current portlet 62 */ 63 64 (_portletId, _node) => {} 65); 66 67Liferay.on( 68 'allPortletsReady', 69 70 /* 71 This function gets loaded when everything, including the portlets, is on 72 the page. 73 */ 74 75 () => { 76 /** 77 * Scroll CRM and Products table at same time. 78 */ 79 const crmTable = document.querySelector('#table-composition'); 80 const productsTable = document.querySelector('#table-products'); 81 82 if (crmTable && productsTable) { 83 crmTable.addEventListener('scroll', event => { 84 productsTable.scrollLeft = crmTable.scrollLeft; 85 }, { passive: true }); 86 87 productsTable.addEventListener('scroll', event => { 88 crmTable.scrollLeft = productsTable.scrollLeft; 89 }, { passive: true }); 90 } 91 92 var jsScrollArea = document.querySelector('.js-scroll-area'); 93 var miniumTop = document.querySelector('[name=minium-top]'); 94 95 function sign(x) { 96 return (x > 0) - (x < 0) || +x; 97 } 98 99 if ('IntersectionObserver' in window) { 100 if (jsScrollArea && miniumTop) { 101 new IntersectionObserver( 102 (entries) => { 103 if (document.getElementById('minium')) { 104 document 105 .getElementById('minium') 106 .classList.toggle( 107 'is-scrolled', 108 !entries[0].isIntersecting 109 ); 110 } 111 }, 112 { 113 114 // root: jsScrollArea, 115 116 rootMargin: '0px', 117 threshold: 1.0, 118 } 119 ).observe(miniumTop); 120 } 121 } 122 123 const scrollThreshold = 100; 124 let lastKnownScrollPosition = 0; 125 let lastKnownScrollOffset = 0; 126 let ticking = false; 127 var myMap = new Map(); 128 myMap.set(-1, 'up'); 129 myMap.set(1, 'down'); 130 131 const miniumWrapper = document.getElementById('minium'); 132 window.addEventListener( 133 'scroll', 134 () => { 135 const offset = window.scrollY - lastKnownScrollPosition; 136 lastKnownScrollPosition = window.scrollY; 137 lastKnownScrollOffset = 138 sign(offset) === sign(lastKnownScrollOffset) 139 ? lastKnownScrollOffset + offset 140 : offset; 141 142 if (!ticking) { 143 window.requestAnimationFrame(() => { 144 if (Math.abs(lastKnownScrollOffset) > scrollThreshold) { 145 miniumWrapper.classList.add( 146 'is-scrolling-' + 147 myMap.get(sign(lastKnownScrollOffset)) 148 ); 149 miniumWrapper.classList.remove( 150 'is-scrolling-' + 151 myMap.get(-1 * sign(lastKnownScrollOffset)) 152 ); 153 } 154 ticking = false; 155 }); 156 ticking = true; 157 } 158 }, 159 false 160 ); 161 162 /* Table scroll */ 163 if ($('#table-composition').length){ 164 var distance = ($('#table-composition').offset().top) + ($('#table-composition').height()); 165 166 $(window).scroll(function () { 167 168 if ($(window).scrollTop() >= distance) { 169 $('#table-composition').addClass("stickySearch"); 170 171 } else { 172 $('#table-composition').removeClass("stickySearch"); 173 } 174 }); 175 } 176 177 const purchaseOrderNumberField = document.getElementById('_com_liferay_commerce_order_content_web_internal_portlet_CommerceOpenOrderContentPortlet_purchaseOrderNumber'); 178 179 if(purchaseOrderNumberField) { 180 purchaseOrderNumberField.setAttribute('disabled', ''); 181 } 182 } 183);
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.