1/** 2 * Implements dismissable notifications. 3 * 4 * To use, insert an element (e.g. a button) with the class 5 * `notification-dismiss` that is the direct child of the element that you 6 * want to be dismissable. For example: 7 * 8 * <div class="notification"> 9 * <button class="notification-dismiss">Go away</button> 10 * The parent .notification div will be hidden when the button is clicked. 11 * </div> 12 * 13 */ 14 15var dismiss_notification_factory = function(elem) { 16 var dismiss_notification = function() { 17 elem.parentElement.style.display = 'none'; 18 } 19 return dismiss_notification; 20} 21 22window.addEventListener('DOMContentLoaded', function() { 23 var elems = document.getElementsByClassName('notification-dismiss'); 24 for (i = 0; i < elems.length; i++) { 25 elems[i].addEventListener('click', dismiss_notification_factory(elems[i])); 26 } 27});
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.