root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / common.js @ 98714f8a
History | View | Annotate | Download (756 Bytes)
1 |
ui = {}; |
---|---|
2 |
|
3 |
|
4 |
ui.closeDiv = function(closeEl, divToCloseClass) { |
5 |
closeEl.click(function(e){
|
6 |
e.preventDefault(); |
7 |
$(this).parents(divToCloseClass).slideUp('slow'); |
8 |
}); |
9 |
} |
10 |
|
11 |
|
12 |
// set lt-sidebar height
|
13 |
ui.setSidebarHeight = function(){ |
14 |
WindowHeight = $(window).height();
|
15 |
ltSidebarHeight = WindowHeight - $('.header').outerHeight(); |
16 |
$('.lt-sidebar').height(ltSidebarHeight); |
17 |
} |
18 |
|
19 |
$(document).ready(function(){ |
20 |
|
21 |
ui.closeDiv($('.info .close'), '.info'); |
22 |
ui.closeDiv($('.dummy-navigation .close'), '.dummy-navigation'); |
23 |
|
24 |
$('.dummy-navigation .our').click(function(e){ |
25 |
e.preventDefault(); |
26 |
$('.ours.'+$(this).data('our')).toggle(); |
27 |
$(this).toggleClass('open'); |
28 |
}); |
29 |
|
30 |
ui.setSidebarHeight(); |
31 |
|
32 |
|
33 |
}) |
34 |
|
35 |
$(window).resize(function(e){ |
36 |
ui.setSidebarHeight(); |
37 |
|
38 |
}) |