Revision 0c887794 snf-astakos-app/astakos/im/static/im/js/common.js
b/snf-astakos-app/astakos/im/static/im/js/common.js | ||
---|---|---|
1 |
function setContainerMinHeight(){ |
|
2 |
|
|
3 |
var h = $('.header').height(); |
|
4 |
var f = $('.footer').height(); |
|
5 |
var w = $(window).height(); |
|
6 |
var pTop = parseInt (($('.container .wrapper').css('padding-top').replace("px", "")) ); |
|
7 |
var pBottom = parseInt (($('.container .wrapper').css('padding-bottom').replace("px", ""))); |
|
1 |
function setContainerMinHeight( applicableDiv){ |
|
2 |
|
|
3 |
if ( $(applicableDiv).length > 0 ) { |
|
4 |
//var h = $('.header').height(); div.header is not found |
|
5 |
var f = $('.footer').height(); |
|
6 |
var w = $(window).height(); |
|
7 |
var pTop = parseInt (($(applicableDiv).css('padding-top').replace("px", "")) ); |
|
8 |
var pBottom = parseInt (($(applicableDiv).css('padding-bottom').replace("px", ""))); |
|
8 | 9 |
|
9 |
var c = w - ( h+f+pTop+pBottom);
|
|
10 |
$('.container .wrapper').css('min-height', c);
|
|
11 |
|
|
10 |
var c = w - ( f+pTop+pBottom+36);//36 is header's height.
|
|
11 |
$(applicableDiv).css('min-height', c);
|
|
12 |
} |
|
12 | 13 |
|
13 | 14 |
} |
14 | 15 |
|
15 | 16 |
$(document).ready(function() { |
16 |
|
|
17 |
setContainerMinHeight(); |
|
17 |
|
|
18 |
|
|
19 |
setContainerMinHeight('.container .wrapper'); |
|
20 |
|
|
18 | 21 |
|
19 | 22 |
$('.show-extra').click(function(e) { |
20 | 23 |
e.preventDefault(); |
... | ... | |
33 | 36 |
$(this).parents('.box-more').toggleClass('border'); |
34 | 37 |
}); |
35 | 38 |
|
36 |
|
|
39 |
var topMargin=parseInt($('.mainlogo').height())+parseInt($('.top-msg').css('marginBottom')); |
|
40 |
$('.mainlogo').css('marginTop','-'+topMargin+'px') |
|
41 |
|
|
37 | 42 |
$('.top-msg a.close').click(function(e) { |
38 |
e.preventDefault(); |
|
39 |
$(this).parents('.top-msg').slideUp('5000', function() { |
|
43 |
$('.top-msg').animate({ |
|
44 |
paddingTop:'0', |
|
45 |
paddingBottom:'0', |
|
46 |
height:'0' |
|
47 |
}, 1000, function (){ |
|
40 | 48 |
$('.top-msg').removeClass('active') |
41 | 49 |
}); |
42 |
}); |
|
43 |
|
|
50 |
$('.mainlogo').animate({ |
|
51 |
marginTop:'0' |
|
52 |
}, 1000, function (){ |
|
53 |
//todo |
|
54 |
}); |
|
55 |
}); |
|
56 |
|
|
44 | 57 |
//$('select').dropkick(); |
45 | 58 |
|
46 |
|
|
47 |
if ( $('#os').length > 0 ) { |
|
48 |
var os = BrowserDetect.OS; |
|
49 |
if ( os!=="an unknown OS" ) { |
|
50 |
$('#os').html('version '+os); |
|
51 |
} |
|
52 |
} |
|
59 |
|
|
53 | 60 |
|
54 | 61 |
$('.top-msg .success').parents('.top-msg').css( |
55 | 62 |
{ |
... | ... | |
74 | 81 |
) |
75 | 82 |
|
76 | 83 |
}); |
84 |
|
|
85 |
$(window).resize(function() { |
|
86 |
|
|
87 |
setContainerMinHeight('.container .wrapper'); |
|
88 |
|
|
89 |
}); |
Also available in: Unified diff