bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/trunk
64.1.1
by b11johgu
ExamplesController: |
1 |
/* Functions */
|
2 |
$(document).ready(function(){ |
|
3 |
drawRows(); |
|
4 |
});
|
|
5 |
||
6 |
/* Expands/hides category data */
|
|
7 |
function categoryExpand(e){ |
|
8 |
e = document.getElementById(e); |
|
9 |
|
|
10 |
$(e).children().not('.categoryMoveUp').not('.categoryMoveDown').not(':first-child').toggle(); |
|
11 |
if($(e).children().find('p').first().hasClass('expanded')){ |
|
12 |
$(e).children().find('p').first().removeClass('expanded'); |
|
13 |
$(e).css('height','25px'); |
|
14 |
|
|
15 |
} |
|
16 |
else{ |
|
17 |
$(e).children().find('p').first().addClass('expanded'); |
|
18 |
$(e).removeAttr('style'); |
|
19 |
} |
|
20 |
drawRows(); |
|
21 |
}
|
|
22 |
||
23 |
function drawRows(){ |
|
24 |
var counter=1; |
|
25 |
$('.row').not(':hidden').each(function(){ |
|
26 |
counter++; |
|
27 |
if(counter % 2){ |
|
28 |
$(this).addClass('odd').removeClass('even'); |
|
29 |
} |
|
30 |
else{ |
|
31 |
$(this).addClass('even').removeClass('odd'); |
|
32 |
} |
|
33 |
}); |
|
34 |
}
|
|
35 |
||
36 |
function categoryMoveUp(e) |
|
37 |
{
|
|
38 |
var targetMenu = $('li[data-name="'+e+'"]'); |
|
39 |
e = document.getElementById(e); |
|
40 |
|
|
41 |
$(e).insertBefore($(e).prev()); |
|
42 |
$(targetMenu).insertBefore((targetMenu).prev().not('li[class="menuHeader"]')); |
|
43 |
|
|
44 |
$(e).addClass('categoryPulse'); |
|
45 |
$(targetMenu).addClass('categoryPulseMini'); |
|
46 |
|
|
47 |
drawRows(); |
|
48 |
}
|
|
49 |
||
50 |
||
51 |
function categoryMoveDown(e) |
|
52 |
{
|
|
53 |
var targetMenu = $('li[data-name="'+e+'"]'); |
|
54 |
e = document.getElementById(e); |
|
55 |
|
|
56 |
$(e).insertAfter($(e).next()); |
|
57 |
$(targetMenu).insertAfter((targetMenu).next()); |
|
58 |
|
|
59 |
$(e).addClass('categoryPulse'); |
|
60 |
$(targetMenu).addClass('categoryPulseMini'); |
|
61 |
|
|
62 |
drawRows(); |
|
63 |
}
|
|
64 |