-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpine.min.js
6 lines (6 loc) · 1.26 KB
/
pine.min.js
1
2
3
4
5
6
/*
* PineJS (http://pinecss.com)
* Copyright 2016, Savas Can ALTUN <[email protected]>
* http://github.com/pineCSS/pine
*/
if("undefined"==typeof jQuery)throw new Error("PineCSS requires jQuery");$.fn.pinebox=function(a){var b=$("#"+a.id),c=a.escape;this.click(function(){window.onclick=function(c){c.target==document.getElementById(a.id)&&b.hide()},b.show()}),$(".pinebox-close").click(function(){b.hide()}),c&&$(document).keyup(function(a){27===a.keyCode&&b.hide()})},$("ul.pinetabs li").click(function(){var a=$(this).attr("data-tab");$("ul.pinetabs li").removeClass("current"),$(".pinetabs-content").removeClass("current"),$(this).addClass("current"),$("#"+a).addClass("current")});for(var accordion=document.getElementsByClassName("pineaccordion"),i=0;i<accordion.length;i++)accordion[i].onclick=function(){this.classList.toggle("active"),this.nextElementSibling.classList.toggle("show")};$("<select class='full-width'/>").appendTo(".pinenavbar"),$("<option />",{selected:"selected",value:"",text:"MENU"}).appendTo(".pinenavbar select"),$(".pinenavbar nav li a").each(function(){var a=$(this);$("<option />",{value:a.attr("href"),text:a.text()}).appendTo(".pinenavbar select"),$(".pinenavbar select").change(function(){window.location=$(this).find("option:selected").val()})});