diff --git a/website/source/javascripts/docs.js b/website/source/javascripts/docs.js new file mode 100644 index 0000000000..3fb8886c35 --- /dev/null +++ b/website/source/javascripts/docs.js @@ -0,0 +1,47 @@ +(function(){ + +var Init = { + + start: function(){ + var classname = this.hasClass(document.body, 'page-sub'); + + if (classname) { + this.addEventListeners(); + } + }, + + hasClass: function (elem, className) { + return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); + }, + + addEventListeners: function(){ + var _this = this; + //console.log(document.querySelectorAll('.navbar-static-top')[0]); + window.addEventListener('resize', _this.resizeImage, false); + + this.resizeImage(); + }, + + resizeImage: function(){ + console.log('resizeImage') + + var header = document.getElementById('header'), + footer = document.getElementById('footer-wrap'), + main = document.getElementById('main-content'), + vp = window.innerHeight, + bodyHeight = document.body.clientHeight, + hHeight = header.clientHeight, + fHeight = footer.clientHeight, + withMinHeight = hHeight + fHeight + 830; + + if(withMinHeight > bodyHeight ){ + var newHeight = (vp - (hHeight+fHeight)) + 'px'; + main.style.height = newHeight; + } + } + +}; + +Init.start(); + +})(); diff --git a/website/source/layouts/_footer.erb b/website/source/layouts/_footer.erb index 830791c164..c3762ba16b 100644 --- a/website/source/layouts/_footer.erb +++ b/website/source/layouts/_footer.erb @@ -23,6 +23,7 @@ + diff --git a/website/source/layouts/inner.erb b/website/source/layouts/inner.erb index 893a43e603..d87a09d587 100644 --- a/website/source/layouts/inner.erb +++ b/website/source/layouts/inner.erb @@ -3,7 +3,7 @@