Revision 78e2d3dd snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/glafkopis.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/glafkopis.js | ||
---|---|---|
19 | 19 |
$('.lt-sidebar li a.flavor_selection').click(function(e){ |
20 | 20 |
e.preventDefault(); |
21 | 21 |
select_flavor = 1; |
22 |
console.log('yio!') |
|
23 | 22 |
var classes = $(this).attr('class').split(" "); |
24 | 23 |
// the second class is: 'small_flavor' or 'medium_flavor' or 'large_flavor' |
25 | 24 |
|
... | ... | |
31 | 30 |
}); |
32 | 31 |
|
33 | 32 |
|
33 |
|
|
34 |
// create network |
|
35 |
// checkbox: basic reaction on click (checked, unchecked) |
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
$('.network_options .check').click(function(e){ |
|
41 |
e.preventDefault(); |
|
42 |
var checkbox = $(this).find('.custom_checkbox'); |
|
43 |
var list = $(this).closest('ul'); |
|
44 |
|
|
45 |
checkAction(checkbox); //allazw to checkbox p pataw |
|
46 |
if(list.hasClass('subnet_options')){ |
|
47 |
checkedBefore = $(this).closest('li').siblings('li').find('span.checkbox-checked'); |
|
48 |
if($(checkedBefore).closest('li').find('a').hasClass('manual')) |
|
49 |
{ |
|
50 |
$(checkedBefore).closest('li').find('.manual_sub').hide(); |
|
51 |
} |
|
52 |
checkAction(checkedBefore); //allazw ta alla checkboxes |
|
53 |
|
|
54 |
if($(this).hasClass('manual')) { |
|
55 |
|
|
56 |
if($(checkbox).text()=='a') { |
|
57 |
$(this).closest('span').find('.manual_sub').hide(); |
|
58 |
} |
|
59 |
else { |
|
60 |
$(this).closest('span').find('.manual_sub').show(); |
|
61 |
} |
|
62 |
|
|
63 |
//$(this).closest('span').find('.manual_sub').toggleClass('hidden'); |
|
64 |
|
|
65 |
} |
|
66 |
} |
|
67 |
else if($(this).closest('li').hasClass('dhcp_option')) { |
|
68 |
if($(checkbox).text()=='a') { |
|
69 |
$('.network_options').find('.subnet_options').hide(); |
|
70 |
} |
|
71 |
else { |
|
72 |
$('.network_options').find('.subnet_options').show(); |
|
73 |
} |
|
74 |
} |
|
75 |
console.log(checkbox); |
|
76 |
}) |
|
34 | 77 |
|
35 | 78 |
}); |
36 | 79 |
|
80 |
|
|
81 |
function checkAction(checkbox) { |
|
82 |
var otherChecked = checkbox.closest('li').siblings('li').find('span.checkbox-checked').length; |
|
83 |
if(otherChecked!=0){ |
|
84 |
checkbox.toggleClass('checkbox-checked'); |
|
85 |
if(checkbox.hasClass('checkbox-checked')){ |
|
86 |
checkbox.html('b'); |
|
87 |
|
|
88 |
} |
|
89 |
else{ |
|
90 |
|
|
91 |
checkbox.html('a'); |
|
92 |
} |
|
93 |
} |
|
94 |
else{ |
|
95 |
console.log('Dn kanw tpt!'); |
|
96 |
} |
|
97 |
} |
|
98 |
|
Also available in: Unified diff