Revision 3dc38c0f snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/vm-wizard.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/vm-wizard.js
8 8
	// sets the width and height of the carousel and its divs
9 9
	set_dimensions: function() {
10 10
		console.log('set dimentions');
11
		ui.wizard.relocation = $('.overlay-wrapper').width();
11
		ui.wizard.relocation = $(window).width();
12 12
		console.log(ui.wizard.relocation);
13 13
		$('.vm-wizard-carousel').children('div').width(ui.wizard.relocation);
14 14
	},
......
35 35
	move_to_step: function(prev_btn, next_btn) {
36 36
		var speed =500;
37 37
		// when the button "next" is pressed show the next step (if there is a next step)
38
		next_btn.click(function(){
39
			event.preventDefault();
38
		next_btn.click(function(e){
39
			e.preventDefault();
40 40
			console.log('you clicked next!')
41 41
			if(ui.wizard.current_step < ui.wizard.vm.total_step){
42 42
				prev_btn.find('span').html('PREVIOUS');
......
57 57
		})
58 58

  
59 59
		// when the button "previous" is pressed show the previous step (if there is a previous step)
60
		prev_btn.click(function(){
61
			event.preventDefault();
60
		prev_btn.click(function(e){
61
			e.preventDefault();
62 62
			if(ui.wizard.current_step > 1){
63 63
				ui.wizard.current_step--;
64 64
				ui.wizard.current_position +=ui.wizard.relocation;
......
73 73
	},
74 74

  
75 75
	// sets the width and height of the steps and of the carousel (in PIXELS)
76
	initialize_relocation: function(start_btns){
77
		start_btns.click(function() {
78
			event.preventDefault();
76
	initialize_relocation: function(){
79 77
			console.log('initialize_relocation');
80 78
			ui.wizard.adjust_to_resized_screen();
81 79
			ui.wizard.set_dimensions();
82
		})
83 80
	},
84 81
	// for the carousel index
85 82
	indicate_step: function(step) {
......
117 114
		e.preventDefault();
118 115
	})
119 116

  
120
	ui.wizard.initialize_relocation(new_vm_btn);
117
	ui.wizard.initialize_relocation();
121 118
	ui.wizard.move_to_step(prev_btn, next_btn);
122 119
	ui.wizard.set_movement_tags(ui.wizard.current_step, prev_btn, next_btn);
123 120

  

Also available in: Unified diff