Revision 3f284f50 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/network-wizard.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/network-wizard.js
1 1
ui.wizard.network = {
2
		 elemID: undefined,
3
			btns: {
4
				cancel: undefined,
5
				create: undefined,
6
				close: undefined,
7
				new_network: undefined
8
			}
2
         elemID: undefined,
3
            btns: {
4
                cancel: undefined,
5
                create: undefined,
6
                close: undefined,
7
                new_network: undefined
8
            }
9 9
}
10 10

  
11 11

  
12 12

  
13 13
$(document).ready(function(){
14 14

  
15
	ui.wizard.network.elemID = '#network-wizard';
15
    ui.wizard.network.elemID = '#network-wizard';
16 16
    ui.wizard.network.btns.new_network = $(ui.wizard.network.elemID);
17 17
    ui.wizard.network.btns.close = ui.wizard.network.btns.new_network.find('.close');
18 18
    ui.wizard.network.btns.cancel = ui.wizard.network.btns.new_network.find('.bottom .nav.prev');
......
20 20

  
21 21

  
22 22
     // create network
23
    // checkbox: basic reaction on click (checked, unchecked)
24 23
    $('.network_options .check').click(function(e){
25
        e.preventDefault();
24
    e.preventDefault();
26 25

  
27
       ui.change_checkbox_state(this);
28
        $(this).parents('li').siblings().find('ul.subnet_options').parent('li').toggle();
26
    ui.change_checkbox_state(this);
27
    $(this).parents('li').siblings().find('ul.subnet_options').parent('li').toggle();
29 28

  
30
        });
29
    });
31 30

  
32 31
    $('.network_options .radio_btn').click(function(e){
33 32
        e.preventDefault();
34 33

  
35
        // an einai radiobtn epetrpse na einai ena anameno k kane oti prepei an exw manual mesa
36

  
37 34
        var state = $(this).find('span');
38 35
        if(state.hasClass('snf-radio-unchecked')) {
39
        	ui.check_one_radiobtn(this);
40
        	ui.change_radiobutton_state(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
        	}
36
            ui.check_one_radiobtn(this);
37
            ui.change_radiobutton_state(this);
38

  
39
            if($(this).hasClass('manual')) {
40
                $(this).siblings('.manual_sub').toggle();
41
            }
42
            else {
43
                $(this).closest('li').siblings().find('.manual_sub').hide();
44
            }
48 45
        }
49 46
       
50 47
    })

Also available in: Unified diff