commit 3b69813761c2b36ccd6b7a7d9f38ff16ef20d185
Author: Athina Bekakou <athinabek@grnet.gr>
Date:   Tue Feb 25 12:42:55 2014 +0200

    new ui: improve move and close operations of  wizards

diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js
index 95d581e..c53752f 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember.js
@@ -439,50 +439,56 @@ Synnefo.ImageController = Synnefo.ElemController.extend({
 /* Controllers for Wizards */
 
 Synnefo.CreateController = Ember.ObjectController.extend({
-	currentStep: undefined,
+	currentStep: 1,
 
 	totalSteps: function() {
 		return this.get('stepsContent').length;
 	}.property(),
 
-	init: function() {
-		this._super();
-		this.set('currentStep', 1)
-	},
 	btnLeftLabel: function(){
-	return (this.get('currentStep') === 1)?'CANCEL':'PREVIOUS';
+		return (this.get('currentStep') === 1)?'CANCEL':'PREVIOUS';
 	}.property('currentStep'),
 
 	btnRightLabel: function(){
-	return (this.get('currentStep') === this.get('totalSteps'))?'CREATE':'NEXT';
+		return (this.get('currentStep') === this.get('totalSteps'))?'CREATE':'NEXT';
 	}.property('currentStep'),
 
 	onMove: false,
 	directionMove: undefined,
-
+	init: function() {
+		this._super();
+		this.set('currentStep', 1);
+		this.set('onMove', false);
+		this.set('directionMove', undefined);
+	},
 	actions: {
 		moveNext: function() {
+			console.log('[CreateController moveNext]');
 			if(!this.get('onMove')) {
-				var step = this.get('currentStep');
-				if(step=== this.get('totalSteps')) {
-					this.init();
-					this.get('target').send('closeWizard');
+				if(this.get('currentStep') === this.get('totalSteps'))
+					this.resetClose();
+				else {
+					this.set('directionMove', 'next');
+					this.set('onMove', true);
 				}
-				this.set('directionMove', 'next');
-				this.set('onMove', !(this.get('onMove')));
 			}
 		},
 		moveBack: function() {
+			console.log('[CreateController moveBack]');
 			if(!this.get('onMove')) {
-				var step = this.get('currentStep');
-				if(step === 1) {
-					this.init();
-					this.get('target').send('closeWizard');
+				if(this.get('currentStep') === 1)
+					this.resetClose();
+				else {
+					this.set('directionMove', 'prev');
+					this.set('onMove', true);
 				}
-				this.set('directionMove', 'prev');
-				this.set('onMove', !(this.get('onMove')));
 			}
 		},
+	},
+	resetClose: function() {
+		console.log('[CreateController resetClose]');
+		this.get('target').send('closeWizard');
+		this.init();
 	}
 
 });
@@ -496,13 +502,13 @@ Synnefo.VmsCreateController = Synnefo.CreateController.extend();
 
 Ember.View.reopen({
     didInsertElement: function() {
-       this.set('elIsInserted', true);
        this._super();
+       this.set('elIsInserted', true);
     },
 
     willDestroyElement: function() {
-       this.set('elIsInserted', false);
        this._super();
+       this.set('elIsInserted', false);
     }
 });
 
@@ -693,10 +699,10 @@ Synnefo.WizardStepsView = Synnefo.CollectionView.extend({
 							viewCurrent.set('isCurrent', false);
 							viewToDisplay.set('isCurrent', true);
 							self.get('controller').set('currentStep',viewToDisplay.get('index'));
+							this.get('controller').set('onMove', false);
 						}, this)
 					});
 				}
-				this.get('controller').set('onMove', false);
 			}
 		}
 	}.observes('controller.onMove'),
@@ -753,10 +759,12 @@ Synnefo.WizardSubMenuView = Synnefo.CollectionView.extend({
 		isCurrent: function(){
 			if(this.get('isFirst')) return true;
 		}.property(),
-		click: function() {
+		move: function() {
+			if(this.get('controller').get('onMove')) {
 			this.get('parentView').removeOtherCurrent(this);
-			this.set('isCurrent', true)
-		}
+			this.set('isCurrent', true);
+			}
+		}.observes('controller.onMove')
 	})
 });
 
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/controllers.js b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/controllers.js
index 110d296..3951f80 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/controllers.js
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/controllers.js
@@ -113,50 +113,56 @@ Synnefo.ImageController = Synnefo.ElemController.extend({
 /* Controllers for Wizards */
 
 Synnefo.CreateController = Ember.ObjectController.extend({
-	currentStep: undefined,
+	currentStep: 1,
 
 	totalSteps: function() {
 		return this.get('stepsContent').length;
 	}.property(),
 
-	init: function() {
-		this._super();
-		this.set('currentStep', 1)
-	},
 	btnLeftLabel: function(){
-	return (this.get('currentStep') === 1)?'CANCEL':'PREVIOUS';
+		return (this.get('currentStep') === 1)?'CANCEL':'PREVIOUS';
 	}.property('currentStep'),
 
 	btnRightLabel: function(){
-	return (this.get('currentStep') === this.get('totalSteps'))?'CREATE':'NEXT';
+		return (this.get('currentStep') === this.get('totalSteps'))?'CREATE':'NEXT';
 	}.property('currentStep'),
 
 	onMove: false,
 	directionMove: undefined,
-
+	init: function() {
+		this._super();
+		this.set('currentStep', 1);
+		this.set('onMove', false);
+		this.set('directionMove', undefined);
+	},
 	actions: {
 		moveNext: function() {
+			console.log('[CreateController moveNext]');
 			if(!this.get('onMove')) {
-				var step = this.get('currentStep');
-				if(step=== this.get('totalSteps')) {
-					this.init();
-					this.get('target').send('closeWizard');
+				if(this.get('currentStep') === this.get('totalSteps'))
+					this.resetClose();
+				else {
+					this.set('directionMove', 'next');
+					this.set('onMove', true);
 				}
-				this.set('directionMove', 'next');
-				this.set('onMove', !(this.get('onMove')));
 			}
 		},
 		moveBack: function() {
+			console.log('[CreateController moveBack]');
 			if(!this.get('onMove')) {
-				var step = this.get('currentStep');
-				if(step === 1) {
-					this.init();
-					this.get('target').send('closeWizard');
+				if(this.get('currentStep') === 1)
+					this.resetClose();
+				else {
+					this.set('directionMove', 'prev');
+					this.set('onMove', true);
 				}
-				this.set('directionMove', 'prev');
-				this.set('onMove', !(this.get('onMove')));
 			}
 		},
+	},
+	resetClose: function() {
+		console.log('[CreateController resetClose]');
+		this.get('target').send('closeWizard');
+		this.init();
 	}
 
 });
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/views.js b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/views.js
index 4fc1ac2..b7d1a24 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/views.js
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/views.js
@@ -3,13 +3,13 @@
 
 Ember.View.reopen({
     didInsertElement: function() {
-       this.set('elIsInserted', true);
        this._super();
+       this.set('elIsInserted', true);
     },
 
     willDestroyElement: function() {
-       this.set('elIsInserted', false);
        this._super();
+       this.set('elIsInserted', false);
     }
 });
 
@@ -200,10 +200,10 @@ Synnefo.WizardStepsView = Synnefo.CollectionView.extend({
 							viewCurrent.set('isCurrent', false);
 							viewToDisplay.set('isCurrent', true);
 							self.get('controller').set('currentStep',viewToDisplay.get('index'));
+							this.get('controller').set('onMove', false);
 						}, this)
 					});
 				}
-				this.get('controller').set('onMove', false);
 			}
 		}
 	}.observes('controller.onMove'),
@@ -260,10 +260,12 @@ Synnefo.WizardSubMenuView = Synnefo.CollectionView.extend({
 		isCurrent: function(){
 			if(this.get('isFirst')) return true;
 		}.property(),
-		click: function() {
+		move: function() {
+			if(this.get('controller').get('onMove')) {
 			this.get('parentView').removeOtherCurrent(this);
-			this.set('isCurrent', true)
-		}
+			this.set('isCurrent', true);
+			}
+		}.observes('controller.onMove')
 	})
 });
 
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates.js b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates.js
index 9e82068..77a46cb 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates.js
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates.js
@@ -269,7 +269,7 @@ helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
 
   data.buffer.push("<section class=\"overlay-area-custom\">\n	<div id=\"vm-wizard\" class=\"overlay-div wizard\">\n		<div class=\"top\">\n			<div class=\"numbers row\">\n					");
   data.buffer.push(escapeExpression((helper = helpers['close-1'] || (depth0 && depth0['close-1']),options={hash:{
-    'action': ("closeWizard")
+    'action': ("resetClose")
   },hashTypes:{'action': "STRING"},hashContexts:{'action': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, "close-1", options))));
   data.buffer.push("\n					");
   data.buffer.push(escapeExpression((helper = helpers.collection || (depth0 && depth0.collection),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "Synnefo.WizardHeadersView", options) : helperMissing.call(depth0, "collection", "Synnefo.WizardHeadersView", options))));
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates/wizard.hbs b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates/wizard.hbs
index c12bf71..524ef36 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates/wizard.hbs
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/templates/wizard.hbs
@@ -2,7 +2,7 @@
 	<div id="vm-wizard" class="overlay-div wizard">
 		<div class="top">
 			<div class="numbers row">
-					{{close-1 action="closeWizard"}}
+					{{close-1 action="resetClose"}}
 					{{collection Synnefo.WizardHeadersView}}
 			</div>
 			{{collection Synnefo.WizardSubMenusView}}
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/sass/_wizards.scss b/snf-cyclades-app/synnefo/ui/new_ui/ui/sass/_wizards.scss
index 18b5676..9db9a00 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/sass/_wizards.scss
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/sass/_wizards.scss
@@ -147,7 +147,7 @@
 						// background-color: cyan;
 						border: 1px solid white;
 						position: absolute;
-						top:0;
+						// top:0;
 						width:100%;
 						display:none;
 						padding:50px 0 50px;
diff --git a/snf-cyclades-app/synnefo/ui/new_ui/ui/stylesheets/app.css b/snf-cyclades-app/synnefo/ui/new_ui/ui/stylesheets/app.css
index 2070193..e5610aa 100644
--- a/snf-cyclades-app/synnefo/ui/new_ui/ui/stylesheets/app.css
+++ b/snf-cyclades-app/synnefo/ui/new_ui/ui/stylesheets/app.css
@@ -9496,7 +9496,6 @@ body .jspVerticalBar .jspArrow.jspArrowUp {
 .body-wrapper .overlay-area-custom .overlay-div.wizard .middle .step {
   border: 1px solid white;
   position: absolute;
-  top: 0;
   width: 100%;
   display: none;
   padding: 50px 0 50px;
