Skip to content

Commit

Permalink
Revert "Changed from pushState to replaceState"
Browse files Browse the repository at this point in the history
  • Loading branch information
impallari committed Jun 26, 2015
1 parent fcfd2f8 commit 8a7944d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 45 deletions.
9 changes: 0 additions & 9 deletions .gitignore

This file was deleted.

43 changes: 7 additions & 36 deletions js/init.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8a7944d

Please sign in to comment.