Skip to content

Commit

Permalink
added old functions again to not break apps, but show a deprecation w…
Browse files Browse the repository at this point in the history
…arning
  • Loading branch information
BernhardPosselt committed Oct 29, 2012
1 parent db5e8f3 commit c4b8bb1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions core/js/js.js
Expand Up @@ -468,6 +468,36 @@ function object(o) {
return new F();
}

/**
* Fills height of window. (more precise than height: 100%;)
*/
function fillHeight(selector) {
if (selector.length === 0) {
return;
}
var height = parseFloat($(window).height())-selector.offset().top;
selector.css('height', height + 'px');
if(selector.outerHeight() > selector.height()){
selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px');
}
console.warn("This function is deprecated! Use CSS instead");
}

/**
* Fills height and width of window. (more precise than height: 100%; or width: 100%;)
*/
function fillWindow(selector) {
if (selector.length === 0) {
return;
}
fillHeight(selector);
var width = parseFloat($(window).width())-selector.offset().left;
selector.css('width', width + 'px');
if(selector.outerWidth() > selector.width()){
selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px');
}
console.warn("This function is deprecated! Use CSS instead");
}

$(document).ready(function(){

Expand Down

0 comments on commit c4b8bb1

Please sign in to comment.