diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8bfaac4..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db diff --git a/js/init.js b/js/init.js index 8ce51bf..1611086 100644 --- a/js/init.js +++ b/js/init.js @@ -1,48 +1,19 @@ -$(document).ready(function(){ + $(document).ready(function(){ // Tabs var tabContainers = $('div.tabs > div'); - - function tabTrigger(link, hash) { - tabContainers.hide().filter(hash).show(); + $('div.tabs ul.tabNavigation a').click(function () { + tabContainers.hide().filter(this.hash).show(); $('div.tabs ul.tabNavigation a').removeClass('selected'); - link.addClass('selected'); - } - - if (location.hash) { - // Make sure page jump back to top - setTimeout(function() { - window.scrollTo(0, 0); - }, 1); - } - - if (window.location.hash) { - var hash = window.location.hash - link = $('div.tabs ul.tabNavigation a[href="'+hash+'"]'); - tabTrigger(link, hash); - } else { - var link = $('div.tabs ul.tabNavigation a').filter(':first'), - hash = link.attr('href'); - tabTrigger(link, hash); - }; - - $('div.tabs ul.tabNavigation a').click(function (event) { - var link = $(this), - hash = link.attr('href'); - tabTrigger(link, hash); - // History API - if(history.replaceState) { - history.replaceState(null, null, hash); - }; - event.preventDefault(); + $(this).addClass('selected'); return false; - }); + }).filter(':first').click(); // OT Features Panel $('#showhide').click(function () { $('#otfeatures').slideToggle("fast", function() { - $("#showhide").text($(this).is(':visible') ? "Hide OpenType Features" : "OpenType Features"); - }); + $("#showhide").text($(this).is(':visible') ? "Hide OpenType Features" : "OpenType Features"); + }); }); // OT Features initial Run