Revision 8db75456 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/glafkopis.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/glafkopis.js | ||
---|---|---|
39 | 39 |
|
40 | 40 |
$('.network_options .check').click(function(e){ |
41 | 41 |
e.preventDefault(); |
42 |
var checkbox = $(this).find('.custom_checkbox');
|
|
42 |
var checkbox = $(this).find('.snf-checkbox-checked, .snf-checkbox-unchecked');
|
|
43 | 43 |
var list = $(this).closest('ul'); |
44 | 44 |
|
45 | 45 |
checkAction(checkbox); //allazw to checkbox p pataw |
46 | 46 |
if(list.hasClass('subnet_options')){ |
47 |
checkedBefore = $(this).closest('li').siblings('li').find('span.checkbox-checked'); |
|
47 |
checkedBefore = $(this).closest('li').siblings('li').find('span.snf-checkbox-checked');
|
|
48 | 48 |
if($(checkedBefore).closest('li').find('a').hasClass('manual')) |
49 | 49 |
{ |
50 | 50 |
$(checkedBefore).closest('li').find('.manual_sub').hide(); |
... | ... | |
53 | 53 |
|
54 | 54 |
if($(this).hasClass('manual')) { |
55 | 55 |
|
56 |
if($(checkbox).text()=='a') {
|
|
56 |
if($(checkbox).hasClass('snf-checkbox-unchecked')) {
|
|
57 | 57 |
$(this).closest('span').find('.manual_sub').hide(); |
58 |
} |
|
59 |
else { |
|
60 |
$(this).closest('span').find('.manual_sub').show(); |
|
61 |
} |
|
58 |
}
|
|
59 |
else {
|
|
60 |
$(this).closest('span').find('.manual_sub').show();
|
|
61 |
}
|
|
62 | 62 |
|
63 | 63 |
//$(this).closest('span').find('.manual_sub').toggleClass('hidden'); |
64 | 64 |
|
65 | 65 |
} |
66 | 66 |
} |
67 | 67 |
else if($(this).closest('li').hasClass('dhcp_option')) { |
68 |
if($(checkbox).text()=='a') {
|
|
68 |
if($(checkbox).hasClass('snf-checkbox-unchecked')) {
|
|
69 | 69 |
$('.network_options').find('.subnet_options').hide(); |
70 | 70 |
} |
71 | 71 |
else { |
... | ... | |
81 | 81 |
|
82 | 82 |
|
83 | 83 |
function checkAction(checkbox) { |
84 |
var otherChecked = checkbox.closest('li').siblings('li').find('span.checkbox-checked').length; |
|
84 |
var otherChecked = checkbox.closest('li').siblings('li').find('span.snf-checkbox-checked').length;
|
|
85 | 85 |
if(otherChecked!=0){ |
86 |
checkbox.toggleClass('checkbox-checked'); |
|
87 |
if(checkbox.hasClass('checkbox-checked')){ |
|
88 |
checkbox.html('b'); |
|
89 |
|
|
90 |
} |
|
91 |
else{ |
|
92 |
|
|
93 |
checkbox.html('a'); |
|
94 |
} |
|
95 |
} |
|
86 |
checkbox.toggleClass('snf-checkbox-checked'); |
|
87 |
checkbox.toggleClass('snf-checkbox-unchecked'); |
|
88 |
} |
|
96 | 89 |
else{ |
97 | 90 |
console.log('Dn kanw tpt!'); |
98 | 91 |
} |
Also available in: Unified diff