Skip to content

Commit

Permalink
refinements and corrections to fix for #576 (#739)
Browse files Browse the repository at this point in the history

* version was not showing up on pdf link

* add ops director to toc

* Added es namespace for Entity Services lib module.

* Add Entity Services guide.

* Enable copying apidoc from a method to a function. Partially addresses #592.

* Remove XCC.NET apidoc from the doc entries. See internal task 43762.

* Remove Ops Director guide from the book set.

* Remove Application Builder and Info Studio guides. Move Entity Services guide into dev guide section.

* Removed "Early Access" from the landing page title for ML9.

* Strip ea suffix from 9.0 version

* Make 9.0 the default version

* Update document-list.xml (#674)

Added Ops Dir guide

* Remove ops dir book for 9.0-2

* Add opsdir guide back into doc list

* Pull ops dir guide out again

* and put opsdir book back in again

* Add Azure guide.

* Add common criteria guide to the doc list.

* Add common criteria guide for 8.0-7

* Fix for #701 (#725)

Serve up product notices as PDF

It expects-

1. Pdf only guide has entry in document-list.xml with attributes
pdf-only=true and title=“guide title”
2. Corresponding pdf guide is available at pubs/pdf/pdf-only-guide.pdf

Added entry for 8.0 and 9.0 only for product notices in
document-list.xml.

* Comment out PDF-only product notices until build is modified to match.

* Temporarily comment out forward looking books so we can merge to master.

* Uncomment opsdir, cc, and azure guides that were commented out for merge to master.

* Uncommented PDF-only version of the product notices.

* Fix for issue 576 (#734)

* Fix for #701

Serve up product notices as PDF

It expects-

1. Pdf only guide has entry in document-list.xml with attributes
pdf-only=true and title=“guide title”
2. Corresponding pdf guide is available at pubs/pdf/pdf-only-guide.pdf

Added entry for 8.0 and 9.0 only for product notices in
document-list.xml.

* Fix for #576

* Remove Azure guide for 9.0-3.

* Accidentally commented out opsdir. Put it back.

* Fix for 576 (#735)

Additional improvements for the fix to #576.

* Add back the Azure guide.

* Pull azure back out again so I can merge to master.
  • Loading branch information
kcoleman-marklogic committed Sep 27, 2017
1 parent 17a82c3 commit c1616d3
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/apidoc/js/toc_filter.js
Expand Up @@ -69,8 +69,10 @@ $(function() {
// Ensure that non-fragment TOC links highlight appropriate TOC links.
$(document).on('pjax:end', function(event, options) {
var target = $(event.relatedTarget);
// scroll to page content, fix for #576
scrollToPageContent(event.relatedTarget);
// scroll to page content, fix for #576 - added timeout to take care for pages with images.
setTimeout(function() {
scrollToPageContent();
}, 100)
//LOG.debug("pjax:end", event, options, target);
if (target.parents("#api_sub").length) {
LOG.debug("Calling showInTOC via pjax:end handler.", target[0]);
Expand All @@ -86,16 +88,17 @@ $(function() {
});

// scroll to page content
function scrollToPageContent(targetURL) {
var scrollTo = 0;
var hash = targetURL.toString().split("#")[1] || "";
// if target contains hash value e.g. /guide/search-dev/search-api#id_39268, calculate offsetTop
if (hash) {
var target = document.getElementById(hash) || document.getElementsByName(hash)[0];
scrollTo = $(target)[0].offsetTop;
}
$('#page_content').scrollTop(scrollTo);
}
function scrollToPageContent() {
var scrollTo = 0;
var hash = window.location.hash.slice(1) || "";
// if target contains hash value e.g. /guide/search-dev/search-api#id_39268, calculate offsetTop
if (hash) {
var target = document.getElementById(hash) || document.getElementsByName(hash)[0];
scrollTo = $(target)[0] ? $(target)[0].offsetTop : 0;
}
$('#page_content').scrollTop(scrollTo);
};


function tocInitGlobals() {
LOG.debug("tocInitGlobals");
Expand Down Expand Up @@ -248,6 +251,11 @@ function tocInit() {

// If this was a deep link, load and scroll.
updateTocForSelection();

// scroll to page content on page refresh, timeout is intentional for pages with images.
setTimeout(function() {
scrollToPageContent();
}, 100)
}

// This logic is essentially duplicated from the treeview plugin...bad, I know
Expand Down

0 comments on commit c1616d3

Please sign in to comment.