From 09233ad3a7822dd86f903806b1412350400a1f78 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Mon, 16 Nov 2015 14:54:38 -0800 Subject: [PATCH] update for https://github.com/realm/jazzy/pull/352 --- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- document_alamofire/after/docs/js/jazzy.js | 11 ++++++++++- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- document_alamofire1.2/after/docs/js/jazzy.js | 11 ++++++++++- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- document_moya_podspec/after/docs/js/jazzy.js | 11 ++++++++++- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- document_realm_objc/after/docs/js/jazzy.js | 11 ++++++++++- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- document_realm_swift/after/docs/js/jazzy.js | 11 ++++++++++- .../Contents/Resources/Documents/js/jazzy.js | 11 ++++++++++- misc_jazzy_features/after/docs/js/jazzy.js | 11 ++++++++++- 12 files changed, 120 insertions(+), 12 deletions(-) diff --git a/document_alamofire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js b/document_alamofire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_alamofire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js +++ b/document_alamofire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_alamofire/after/docs/js/jazzy.js b/document_alamofire/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_alamofire/after/docs/js/jazzy.js +++ b/document_alamofire/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_alamofire1.2/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js b/document_alamofire1.2/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_alamofire1.2/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js +++ b/document_alamofire1.2/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_alamofire1.2/after/docs/js/jazzy.js b/document_alamofire1.2/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_alamofire1.2/after/docs/js/jazzy.js +++ b/document_alamofire1.2/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_moya_podspec/after/docs/docsets/Moya.docset/Contents/Resources/Documents/js/jazzy.js b/document_moya_podspec/after/docs/docsets/Moya.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_moya_podspec/after/docs/docsets/Moya.docset/Contents/Resources/Documents/js/jazzy.js +++ b/document_moya_podspec/after/docs/docsets/Moya.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_moya_podspec/after/docs/js/jazzy.js b/document_moya_podspec/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_moya_podspec/after/docs/js/jazzy.js +++ b/document_moya_podspec/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/js/jazzy.js b/document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/js/jazzy.js +++ b/document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_realm_objc/after/docs/js/jazzy.js b/document_realm_objc/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_realm_objc/after/docs/js/jazzy.js +++ b/document_realm_objc/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/js/jazzy.js b/document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/js/jazzy.js +++ b/document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/document_realm_swift/after/docs/js/jazzy.js b/document_realm_swift/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/document_realm_swift/after/docs/js/jazzy.js +++ b/document_realm_swift/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/misc_jazzy_features/after/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/js/jazzy.js b/misc_jazzy_features/after/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/misc_jazzy_features/after/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/js/jazzy.js +++ b/misc_jazzy_features/after/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); }); diff --git a/misc_jazzy_features/after/docs/js/jazzy.js b/misc_jazzy_features/after/docs/js/jazzy.js index a32d4008f..4ff9455b6 100755 --- a/misc_jazzy_features/after/docs/js/jazzy.js +++ b/misc_jazzy_features/after/docs/js/jazzy.js @@ -17,7 +17,7 @@ $(document).ready(function() { }); // On token click, toggle its discussion and animate token.marginLeft -$(".token").click(function() { +$(".token").click(function(event) { if (window.jazzy.docset) { return; } @@ -28,4 +28,13 @@ $(".token").click(function() { link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); });