Revision 23a4a31b
b/ui/static/synnefo.js | ||
---|---|---|
1917 | 1917 |
var img_selector = views_map[machines_view]; |
1918 | 1918 |
var cls = states_map[state]; |
1919 | 1919 |
|
1920 |
console.log(state, os, skip_reset_states, remove_state, cls); |
|
1920 | 1921 |
if (os === "unknown") { os = "okeanos" } ; |
1921 | 1922 |
var new_img = 'url("./static/icons/machines/' + size + '/' + os + '-sprite.png")'; |
1922 | 1923 |
|
... | ... | |
1935 | 1936 |
el.removeClass("single-image-state1"); |
1936 | 1937 |
el.removeClass("single-image-state2"); |
1937 | 1938 |
el.removeClass("single-image-state3"); |
1939 |
el.removeClass("single-image-state4"); |
|
1938 | 1940 |
} |
1939 | 1941 |
|
1940 | 1942 |
if (remove_state !== undefined) |
b/ui/templates/machines_icon.html | ||
---|---|---|
171 | 171 |
init_action_indicator_handlers('icon'); |
172 | 172 |
|
173 | 173 |
// handle connect machine image states |
174 |
$("div.connect-arrow, div.running .machine .logo").live('mouseenter',
|
|
174 |
$("div.connect-arrow, div.running .machine .logo").live('mouseover',
|
|
175 | 175 |
function() { |
176 |
if ($(this).parent().parent().find('.status').text() != STATUSES['ACTIVE']) { return }; |
|
176 | 177 |
set_machine_os_image($(this).parent().parent(), "icon", "hover", undefined, 1); |
177 | 178 |
}); |
178 | 179 |
|
179 | 180 |
$("div.connect-arrow, div.running .machine .logo").live('mouseleave', |
180 | 181 |
function() { |
182 |
if ($(this).parent().parent().find('.status').text() != STATUSES['ACTIVE']) { return }; |
|
181 | 183 |
set_machine_os_image($(this).parent().parent(), "icon", "hover", undefined, 1, "hover"); |
184 |
// mouseup outside the element is not fired |
|
185 |
set_machine_os_image($(this).parent().parent(), "icon", "hover", undefined, 1, "click"); |
|
182 | 186 |
}); |
183 | 187 |
|
184 | 188 |
$("div.connect-arrow, div.running .machine .logo").live('mousedown', |
185 |
function() { |
|
189 |
function() { |
|
190 |
if ($(this).parent().parent().find(".connect-arrow:visible").length == 0) { return }; |
|
186 | 191 |
set_machine_os_image($(this).parent().parent(), "icon", "click", undefined, 1); |
187 | 192 |
}); |
188 | 193 |
|
189 | 194 |
$("div.connect-arrow, div.running .machine .logo").live('mouseup', |
190 | 195 |
function() { |
196 |
if ($(this).parent().parent().find(".connect-arrow:visible").length == 0) { return }; |
|
191 | 197 |
set_machine_os_image($(this).parent().parent(), "icon", "click", undefined, 1, "click"); |
192 | 198 |
}); |
193 | 199 |
|
b/ui/templates/machines_single.html | ||
---|---|---|
195 | 195 |
$("div.connect-arrow, .single-image").live('mouseenter', |
196 | 196 |
function() { |
197 | 197 |
// ugly check to see if machine is running |
198 |
if ($(this).parent().find(".terminated-state").length > 0) { return };
|
|
198 |
if ($(this).parent().find(".connect-arrow:visible").length == 0) { return };
|
|
199 | 199 |
set_machine_os_image($(this).parent().parent(), "single", "hover", undefined, 1); |
200 | 200 |
}); |
201 | 201 |
|
202 | 202 |
$("div.connect-arrow, .single-image").live('mouseleave', |
203 | 203 |
function() { |
204 |
if ($(this).parent().find(".terminated-state").length > 0) { return };
|
|
204 |
if ($(this).parent().find(".connect-arrow:visible").length == 0) { return };
|
|
205 | 205 |
set_machine_os_image($(this).parent().parent(), "single", "hover", undefined, 1, "hover"); |
206 |
set_machine_os_image($(this).parent().parent(), "single", "click", undefined, 1, "click"); |
|
206 | 207 |
}); |
207 | 208 |
|
208 | 209 |
$("div.connect-arrow, .single-image").live('mousedown', |
209 | 210 |
function() { |
210 |
if ($(this).parent().find(".terminated-state").length > 0) { return };
|
|
211 |
if ($(this).parent().find(".connect-arrow:visible").length == 0) { return };
|
|
211 | 212 |
set_machine_os_image($(this).parent().parent(), "single", "click", undefined, 1); |
212 | 213 |
}); |
213 | 214 |
|
214 | 215 |
$("div.connect-arrow, .single-image").live('mouseup', |
215 | 216 |
function() { |
216 |
if ($(this).parent().find(".terminated-state").length > 0) { return };
|
|
217 |
if ($(this).parent().find(".connect-arrow:visible").length == 0) { return };
|
|
217 | 218 |
set_machine_os_image($(this).parent().parent(), "single", "click", undefined, 1, "click"); |
218 | 219 |
}); |
219 | 220 |
|
Also available in: Unified diff