Revision 6f4b6de9 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
32 32
	move: function () {
33 33
		var percentage = -(ui.wizard.current_step-1)*100+'%';
34 34
		ui.wizard.setStepHeight($('.step-'+ui.wizard.current_step+''));
35
		$('#dummy-link-'+(ui.wizard.current_step-1)+'').scrollintoview({'duration':0});
35 36
		$('.vm-wizard-carousel').stop(true, true).animate(
36 37
			{ 'left': percentage },
37 38
			ui.wizard.speed
38
			,function(){
39
				$('#dummy-link-'+ui.wizard.current_step+'').scrollintoview({'duration':0});
40
			}
41 39
		);
42 40
		ui.wizard.focusFun();
43 41
		ui.wizard.indicateStep(ui.wizard.current_step);
......
180 178
        $('.expand-link').find('.snf-arrow-up.preselected').toggleClass('snf-arrow-up snf-arrow-down');
181 179
     },
182 180

  
183
    setStepHeight: function(stepEl) {
181
	setStepHeight: function(stepEl) {
184 182
		var h1 = stepEl.height();
185 183
		var h2 = $('.wizard .top').height();
186
		var res =  h1 +h2;
187
	    $('.wizard-content').css('height',res);
184
		var h3 = $('.header').height();
185
		var h4 = $(window).height();
186
		var res2 =  h4-h3-h2-h1;
187
		var res1 =  h1 +h2;
188
		if(res2>h1) {
189
			$('.wizard-content').css('height',res2);
190
		}
191
		else {
192
		    $('.wizard-content').css('height',res1);
193
		}
188 194
	},
189 195

  
190 196
	returnStepHeight: function(stepEl) {
191 197
		var h1 = stepEl.height();
192 198
		var h2 = $('.wizard .top').height();
193
		var res =  h1 +h2;
194
		return res;
199
		var h3 = $('.header').height();
200
		var h4 = $(window).height();
201
		var res2 =  h4-h3-h2-h1;
202
		var res1 =  h1 +h2;
203
		if(res2>h1) {
204
			return res2;
205
		}
206
		else {
207
			return res1;
208
		}
195 209
	},
196 210

  
197 211
	pickResources: function(resource) {
......
221 235
        e.stopPropagation();
222 236
        $(this).toggleClass('current');
223 237
        var self = this;
224
        $(this).parents('li').find('.details').stop().slideToggle('slow', function(){
238
        $(this).parents('li').find('.details').stop().slideToggle('slow', 'easeOutExpo',function(){
225 239
			ui.wizard.setStepHeight($('.step-1'));
226 240
        });
227
    });
241
	});
228 242

  
229 243

  
230 244
/* step-2: Select flavor */

Also available in: Unified diff