[pve-devel] [PATCH manager 2/5] wizard: use fbar convenience helper for footer

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Feb 14 13:34:45 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/window/Wizard.js | 130 +++++++++++++++++++-----------------------
 1 file changed, 60 insertions(+), 70 deletions(-)

diff --git a/www/manager6/window/Wizard.js b/www/manager6/window/Wizard.js
index c23b9199..c9a695b9 100644
--- a/www/manager6/window/Wizard.js
+++ b/www/manager6/window/Wizard.js
@@ -61,75 +61,6 @@ Ext.define('PVE.window.Wizard', {
 	    return valid;
 	};
 
-
-	var tbar = Ext.create('Ext.toolbar.Toolbar', {
-            ui: 'footer',
-	    region: 'south',
-	    margins: '0 5 5 5',
-	    items: [  
-		{
-		    xtype: 'proxmoxHelpButton',
-		    itemId: 'help'
-		},
-		'->', 
-		{ 
-		    text: gettext('Back'),
-		    disabled: true,
-		    itemId: 'back',
-		    minWidth: 60,
-		    handler: function() {
-			var tp = me.down('#wizcontent');
-			var atab = tp.getActiveTab();
-			var prev = tp.items.indexOf(atab) - 1;
-			if (prev < 0) {
-			    return;
-			}
-			var ntab = tp.items.getAt(prev);
-			if (ntab) {
-			    tp.setActiveTab(ntab);
-			}
-
-
-		    }
-		},
-		{
-		    text: gettext('Next'),
-		    disabled: true,
-		    itemId: 'next',
-		    minWidth: 60,
-		    handler: function() {
-
-			var form = me.down('form').getForm();
-
-			var tp = me.down('#wizcontent');
-			var atab = tp.getActiveTab();
-			if (!check_card(atab)) {
-			    return;
-			}
-				       
-			var next = tp.items.indexOf(atab) + 1;
-			var ntab = tp.items.getAt(next);
-			if (ntab) {
-			    ntab.enable();
-			    tp.setActiveTab(ntab);
-			}
-			
-		    }
-		},
-		{
-		    text: gettext('Finish'),
-		    minWidth: 60,
-		    hidden: true,
-		    itemId: 'submit',
-		    handler: function() {
-			var tp = me.down('#wizcontent');
-			var atab = tp.getActiveTab();
-			atab.onSubmit();
-		    }
-		}
-	    ]
-	});
-
 	var disable_at = function(card) {
 	    var tp = me.down('#wizcontent');
 	    var idx = tp.items.indexOf(card);
@@ -201,8 +132,67 @@ Ext.define('PVE.window.Wizard', {
 			},
 			items: tabs
 		    }]
+		}
+	    ],
+	    fbar: [
+		{
+		    xtype: 'proxmoxHelpButton',
+		    itemId: 'help'
 		},
-		tbar
+		'->',
+		{
+		    text: gettext('Back'),
+		    disabled: true,
+		    itemId: 'back',
+		    minWidth: 60,
+		    handler: function() {
+			var tp = me.down('#wizcontent');
+			var atab = tp.getActiveTab();
+			var prev = tp.items.indexOf(atab) - 1;
+			if (prev < 0) {
+			    return;
+			}
+			var ntab = tp.items.getAt(prev);
+			if (ntab) {
+			    tp.setActiveTab(ntab);
+			}
+		    }
+		},
+		{
+		    text: gettext('Next'),
+		    disabled: true,
+		    itemId: 'next',
+		    minWidth: 60,
+		    handler: function() {
+
+			var form = me.down('form').getForm();
+
+			var tp = me.down('#wizcontent');
+			var atab = tp.getActiveTab();
+			if (!check_card(atab)) {
+			    return;
+			}
+
+			var next = tp.items.indexOf(atab) + 1;
+			var ntab = tp.items.getAt(next);
+			if (ntab) {
+			    ntab.enable();
+			    tp.setActiveTab(ntab);
+			}
+
+		    }
+		},
+		{
+		    text: gettext('Finish'),
+		    minWidth: 60,
+		    hidden: true,
+		    itemId: 'submit',
+		    handler: function() {
+			var tp = me.down('#wizcontent');
+			var atab = tp.getActiveTab();
+			atab.onSubmit();
+		    }
+		}
 	    ]
 	});
 	me.callParent();
-- 
2.14.2





More information about the pve-devel mailing list