Sha256: 2174e499f3aec48ce45ab6253104e3d2ff053257660adb24cc3a39834366e719

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

(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();

})();

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/assets/javascripts/app/_docs.js
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/assets/javascripts/app/_docs.js
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/assets/javascripts/app/_docs.js
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/assets/javascripts/app/_docs.js