Revision c2c9975a snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js | ||
---|---|---|
55 | 55 |
var vm_container = $('.vms li .container'); |
56 | 56 |
var vm_img = vm_container.find('.img-wrap'); |
57 | 57 |
|
58 |
vm_img.mouseenter(
|
|
58 |
$('.vms li .container .img').mouseenter(
|
|
59 | 59 |
function (e) { |
60 |
$(this).parents('.container').find('.options').slideDown();
|
|
60 |
$(this).parents('.container').find('.options').fadeIn();
|
|
61 | 61 |
} |
62 | 62 |
); |
63 | 63 |
|
64 | 64 |
$('li .container .options').mouseleave( |
65 | 65 |
function(e){ |
66 |
var checkbox = $(this).find('.custom_checkbox'); |
|
67 |
|
|
68 |
if (checkbox.hasClass('checkbox-checked')){ |
|
69 |
checkbox.parents('.container').find('.more_checkbox').html(checkbox.clone()); |
|
70 |
|
|
71 |
} else { |
|
72 |
checkbox.parents('.container').find('.more_checkbox').html(''); |
|
73 |
} |
|
74 |
$('li .container .options').hide(); |
|
75 |
|
|
76 |
|
|
66 |
$('li .container .options').fadeOut(); |
|
77 | 67 |
} |
78 | 68 |
); |
79 | 69 |
|
... | ... | |
85 | 75 |
|
86 | 76 |
if(checkbox.hasClass('checkbox-checked')){ |
87 | 77 |
checkbox.html('b'); |
78 |
$(this).parents('.container').find('.options').fadeOut(); |
|
79 |
|
|
80 |
} |
|
81 |
else{ |
|
82 |
checkbox.html('a'); |
|
83 |
|
|
84 |
} |
|
85 |
if (checkbox.hasClass('checkbox-checked')){ |
|
86 |
checkbox.parents('.container').find('.more_checkbox').html(checkbox.clone()); |
|
87 |
|
|
88 |
} else { |
|
89 |
checkbox.parents('.container').find('.more_checkbox').html(''); |
|
90 |
} |
|
91 |
ui.cntCheckbox(); |
|
92 |
}) |
|
93 |
$('.more_checkbox').on('click', function(e){ |
|
94 |
|
|
95 |
var checkbox = $(this).find('span'); |
|
96 |
checkbox.toggleClass('checkbox-checked'); |
|
97 |
var self = $(this); |
|
98 |
if(checkbox.hasClass('checkbox-checked')){ |
|
99 |
checkbox.html('b'); |
|
100 |
$(this).parents('.container').find('.options').fadeOut(); |
|
101 |
self.parents('.container').find('.custom_checkbox').addClass('checkbox-checked'); |
|
102 |
self.parents('.container').find('.custom_checkbox').html('b'); |
|
103 |
|
|
88 | 104 |
} |
89 | 105 |
else{ |
90 | 106 |
checkbox.html('a'); |
107 |
self.parents('.container').find('.custom_checkbox').removeClass('checkbox-checked'); |
|
108 |
self.parents('.container').find('.custom_checkbox').html('a'); |
|
91 | 109 |
|
92 | 110 |
} |
111 |
|
|
112 |
|
|
113 |
if (!(checkbox.hasClass('checkbox-checked'))){ |
|
114 |
self.html(''); |
|
115 |
} |
|
93 | 116 |
ui.cntCheckbox(); |
94 | 117 |
}) |
95 | 118 |
} |
Also available in: Unified diff