root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / network-wizard.js @ bdf1d2fd
History | View | Annotate | Download (2 kB)
1 |
ui.wizard.network = { |
---|---|
2 |
elemID: undefined, |
3 |
btns: {
|
4 |
cancel: undefined, |
5 |
create: undefined, |
6 |
close: undefined, |
7 |
new_network: undefined |
8 |
}, |
9 |
close: function(bottom_area, main_area, total_area) { |
10 |
$('body').removeClass('with-overlay'); |
11 |
$('.overlay-area').fadeOut(400, function() { |
12 |
$('.overlay-div').hide(); |
13 |
}); |
14 |
} |
15 |
} |
16 |
|
17 |
|
18 |
$(document).ready(function(){ |
19 |
$('#network-wizard').find('a').click(function(e) { |
20 |
e.preventDefault(); |
21 |
}); |
22 |
ui.wizard.network.elemID = '#network-wizard';
|
23 |
ui.wizard.network.btns.new_network = $(ui.wizard.network.elemID);
|
24 |
ui.wizard.network.btns.close = ui.wizard.network.btns.new_network.find('.close');
|
25 |
ui.wizard.network.btns.cancel = ui.wizard.network.btns.new_network.find('.bottom .nav.prev');
|
26 |
ui.wizard.network.btns.create = ui.wizard.network.btns.new_network.find('.bottom .nav.next');
|
27 |
|
28 |
|
29 |
// create network
|
30 |
$('.network_options .check').click(function(e){ |
31 |
e.preventDefault(); |
32 |
$(this).parents('li').siblings().find('ul.subnet_options').parent('li').toggle(); |
33 |
}); |
34 |
|
35 |
$('.network_options .radio_btn').click(function(e){ |
36 |
e.preventDefault(); |
37 |
var state = $(this).find('span'); |
38 |
if(state.hasClass('snf-radio-unchecked')) { |
39 |
ui.checkOneRadioButton(this);
|
40 |
ui.changeRadiobuttonState(this);
|
41 |
|
42 |
if($(this).hasClass('manual')) { |
43 |
$(this).siblings('.manual_sub').toggle(); |
44 |
} |
45 |
else {
|
46 |
$(this).closest('li').siblings().find('.manual_sub').hide(); |
47 |
} |
48 |
} |
49 |
|
50 |
}); |
51 |
$(ui.wizard.network.btns.cancel).click(function(e) { |
52 |
ui.wizard.network.close('.bottom', '#network-wizard', '.overlay-area'); |
53 |
}); |
54 |
$(ui.wizard.network.btns.create).click(function(e) { |
55 |
ui.wizard.network.close('.bottom', '#network-wizard', '.overlay-area'); |
56 |
}); |
57 |
$(ui.wizard.network.btns.close).click(function(e) { |
58 |
ui.wizard.network.close('.bottom', '#network-wizard', '.overlay-area'); |
59 |
}); |
60 |
|
61 |
}) |