1function injectAsidebar(jQuery) { 2 jQuery.fn.asidebar = function asidebar(status) { 3 switch (status) { 4 case "open": 5 var that = this; 6 // fade in backdrop 7 if ($(".aside-backdrop").length === 0) { 8 $("body").append("<div class='aside-backdrop'></div>"); 9 10 $("html, body").addClass("not_scroll"); 11 } 12 $(".aside-backdrop").addClass("in"); 13 14 function close() { 15 $(that).asidebar.apply(that, ["close"]); 16 } 17 18 // slide in asidebar 19 $(this).addClass("in"); 20 $(this).find("[data-dismiss=aside], [data-dismiss=asidebar]").on('click', close); 21 $(".aside-backdrop").on('click', close); 22 break; 23 case "close": 24 // fade in backdrop 25 if ($(".aside-backdrop.in").length > 0) { 26 $(".aside-backdrop").removeClass("in"); 27 $("html, body").removeClass("not_scroll"); 28 } 29 30 // slide in asidebar 31 $(this).removeClass("in"); 32 break; 33 case "toggle": 34 if($(this).attr("class").split(' ').indexOf('in') > -1) { 35 $(this).asidebar("close"); 36 } else { 37 $(this).asidebar("open"); 38 } 39 break; 40 } 41 } 42} 43 44// support browser and node 45if (typeof jQuery !== "undefined") { 46 injectAsidebar(jQuery); 47} else if (typeof module !== "undefined" && module.exports) { 48 module.exports = injectAsidebar; 49}
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.