diff --git a/website/source/assets/javascripts/_app/docs.js b/website/source/assets/javascripts/_app/docs.js new file mode 100644 index 0000000000..a0ab205cf0 --- /dev/null +++ b/website/source/assets/javascripts/_app/docs.js @@ -0,0 +1,48 @@ +(function(){ + +var mainContentMin = 600; + +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(){ + + var header = document.getElementById('header'), + footer = document.getElementById('footer'), + main = document.getElementById('main-content'), + vp = window.innerHeight, + bodyHeight = document.body.clientHeight, + hHeight = header.clientHeight, + fHeight = footer.clientHeight, + withMinHeight = hHeight + fHeight + mainContentMin; + + if(withMinHeight < vp && bodyHeight < vp){ + var newHeight = mainContentMin + (vp-withMinHeight) + 'px'; + main.style.height = newHeight; + } + } + +}; + +Init.start(); + +})(); diff --git a/website/source/assets/javascripts/application.coffee b/website/source/assets/javascripts/application.coffee index cd144c6b25..8221cd501a 100644 --- a/website/source/assets/javascripts/application.coffee +++ b/website/source/assets/javascripts/application.coffee @@ -4,6 +4,7 @@ #= require lib/Base +#= require _app/docs #= require _app/Sidebar #= require _app/app #= require _app/homepage diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 0eec13740d..84969297a4 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -6,6 +6,10 @@ body.layout-docs, body.layout-intro{ background: $light-purple image-url('sidebar-dots.jpg') left 62px no-repeat; + #main-content{ + min-height: 600px; + } + >.container{ .col-md-8[role=main]{ min-height: 800px; 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 @@
<%= yield_content :sidebar %>
-
+
<%= yield %>