diff --git a/source/js/src/algolia-search.js b/source/js/src/algolia-search.js index 954fd057e4..06decd8cb6 100644 --- a/source/js/src/algolia-search.js +++ b/source/js/src/algolia-search.js @@ -37,12 +37,18 @@ $(document).ready(function() { templates : { item: function(data) { var link = data.permalink ? data.permalink : CONFIG.root + data.path; - return `${data._highlightResult.title.value}`; + return ( + '' + + data._highlightResult.title.value + + '' + ); }, empty: function(data) { - return `
- ${algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query)} -
`; + return ( + '
' + + algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query) + + '
' + ); } }, cssClasses: { @@ -57,11 +63,13 @@ $(document).ready(function() { var stats = algoliaSettings.labels.hits_stats .replace(/\$\{hits}/, data.nbHits) .replace(/\$\{time}/, data.processingTimeMS); - return `${stats} - - Algolia - -
`; + return ( + stats + + '' + + ' Algolia' + + '' + + '
' + ); } } }), diff --git a/source/js/src/scrollspy.js b/source/js/src/scrollspy.js index be16bf0f8f..7efacace41 100644 --- a/source/js/src/scrollspy.js +++ b/source/js/src/scrollspy.js @@ -119,7 +119,9 @@ this.clear(); - var selector = `${this.selector}[data-target="${target}"],${this.selector}[href="${target}"]`; + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]'; var active = $(selector) .parents('li') diff --git a/source/js/src/utils.js b/source/js/src/utils.js index 01886d8512..0f3704e2f7 100644 --- a/source/js/src/utils.js +++ b/source/js/src/utils.js @@ -16,13 +16,13 @@ NexT.utils = NexT.$u = { if ($imageWrapLink.length < 1) { var imageLink = $image.attr('data-original') ? this.getAttribute('data-original') : this.getAttribute('src'); - $imageWrapLink = $image.wrap(``).parent('a'); + $imageWrapLink = $image.wrap('').parent('a'); $imageWrapLink.addClass('fancybox fancybox.image'); $imageWrapLink.attr('rel', 'group'); } if (imageTitle) { - $imageWrapLink.append(`

${imageTitle}

`); + $imageWrapLink.append('

' + imageTitle + '

'); //make sure img title tag will show correctly in fancybox $imageWrapLink.attr('title', imageTitle); @@ -57,7 +57,7 @@ NexT.utils = NexT.$u = { $(window).bind('hashchange', function() { var tHash = location.hash; if (tHash !== '' && !tHash.match(/%\S{2}/)) { - $(`${tNav}li:has(a[href="${tHash}"])`).addClass('active').siblings().removeClass('active'); + $(tNav + 'li:has(a[href="' + tHash + '"])').addClass('active').siblings().removeClass('active'); $(tHash).addClass('active').siblings().removeClass('active'); } }).trigger('hashchange'); @@ -256,7 +256,7 @@ NexT.utils = NexT.$u = { }, getScrollbarWidth: function() { - var $div = $('
').addClass('scrollbar-measure').prependTo('body'); + var $div = $('
').addClass('scrollbar-measure').prependTo('body'); var div = $div[0]; var scrollbarWidth = div.offsetWidth - div.clientWidth; $div.remove(); @@ -295,6 +295,7 @@ $(document).ready(function() { * Init Sidebar & TOC inner dimensions on all pages and for all schemes. * Need for Sidebar/TOC inner scrolling if content taller then viewport. */ + function updateSidebarHeight(height) { height = height || 'auto'; $('.site-overview, .post-toc').css('max-height', height); @@ -316,10 +317,10 @@ $(document).ready(function() { // Initialize Sidebar & TOC Width. var scrollbarWidth = NexT.utils.getScrollbarWidth(); if ($('.site-overview-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) { - $('.site-overview').css('width', `calc(100% + ${scrollbarWidth}px)`); + $('.site-overview').css('width', 'calc(100% + ' + scrollbarWidth + 'px)'); } if ($('.post-toc-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) { - $('.post-toc').css('width', `calc(100% + ${scrollbarWidth}px)`); + $('.post-toc').css('width', 'calc(100% + ' + scrollbarWidth + 'px)'); } // Initialize Sidebar & TOC Height.