diff options
Diffstat (limited to 'js/karma.js')
-rwxr-xr-x | js/karma.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/js/karma.js b/js/karma.js index cd813da..9c05837 100755 --- a/js/karma.js +++ b/js/karma.js @@ -241,7 +241,6 @@ Karma.convertNumToLocale = function(num, locale){ }; var charArray = num.toString().split("").map(convertDigit); - console.log(charArray.join('')); return eval('"' + charArray.join('') + '"'); }; @@ -257,6 +256,25 @@ Karma.convertNumToLocale = function(num, locale){ */ Karma._n = Karma.convertNumToLocale; +/* Scales the dimensions of document.body to the innerHeight and innerWidth + * of the viewport, i.e. browser window, with a minor offset to the height to + * make sure the scrollbars do not appear + */ +Karma.scaleToViewport = function(){ + var width = window.innerWidth; + var height = window.innerHeight; + + //hack to ensure scrollbars don't appear + if (height === 900){ + height = "" + 884 + "px"; + } else { + height = "" + (height - 13) + "px"; + } + + document.body.style.width = "" + width + "px"; + document.body.style.height = height; +}; + // Below are geometry and math helper methods /** |