1/** 2 * UI Toasts 3 */ 4 5'use strict'; 6 7function Toast () { 8 // Bootstrap toasts example 9 // -------------------------------------------------------------------- 10 const toastPlacementExample = document.querySelector('.toast-placement-ex'), 11 toastPlacementBtn = document.querySelector('#showToastPlacement'); 12 let selectedType, selectedPlacement, toastPlacement; 13 14 // Dispose toast when open another 15 function toastDispose(toast) { 16 if (toast && toast._element !== null) { 17 if (toastPlacementExample) { 18 toastPlacementExample.classList.remove(selectedType); 19 DOMTokenList.prototype.remove.apply(toastPlacementExample.classList, selectedPlacement); 20 } 21 toast.dispose(); 22 } 23 } 24 // Placement Button click 25 if (toastPlacementBtn) { 26 toastPlacementBtn.onclick = function () { 27 if (toastPlacement) { 28 toastDispose(toastPlacement); 29 } 30 selectedType = document.querySelector('#selectTypeOpt').value; 31 selectedPlacement = document.querySelector('#selectPlacement').value.split(' '); 32 33 toastPlacementExample.classList.add(selectedType); 34 DOMTokenList.prototype.add.apply(toastPlacementExample.classList, selectedPlacement); 35 toastPlacement = new bootstrap.Toast(toastPlacementExample); 36 toastPlacement.show(); 37 }; 38 } 39};
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.