From 3b422683cf593a54cad672f9f238d4820a5e84d4 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 10 Mar 2016 11:46:57 +0100 Subject: [PATCH] ext6migrate: fix ContentView we move the static configuration to the class definition we change the deprecated autoScroll to scrollable we change applyIf to apply (when appropriate) we change "new Ext..." to Ext.create we change the event from show to activate also we change the button height of the upload to 32 so that it matches the textfield (looks weird otherwise) Signed-off-by: Dominik Csapak --- www/manager6/storage/ContentView.js | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js index 5c2b24e4..c0edf81e 100644 --- a/www/manager6/storage/ContentView.js +++ b/www/manager6/storage/ContentView.js @@ -3,6 +3,10 @@ Ext.define('PVE.grid.TemplateSelector', { alias: 'widget.pveTemplateSelector', + stateful: false, + viewConfig: { + trackOver: false + }, initComponent : function() { var me = this; @@ -35,10 +39,6 @@ Ext.define('PVE.grid.TemplateSelector', { Ext.apply(me, { store: store, selModel: sm, - stateful: false, - viewConfig: { - trackOver: false - }, features: [ groupingFeature ], columns: [ { @@ -88,14 +88,17 @@ Ext.define('PVE.storage.TemplateDownload', { alias: 'widget.pveTemplateDownload', modal: true, - + title: gettext('Templates'), + layout: 'fit', + width: 600, + height: 400, initComponent : function() { /*jslint confusion: true */ var me = this; var grid = Ext.create('PVE.grid.TemplateSelector', { border: false, - autoScroll: true, + scrollable: true, nodename: me.nodename }); @@ -129,11 +132,7 @@ Ext.define('PVE.storage.TemplateDownload', { } }); - Ext.applyIf(me, { - title: gettext('Templates'), - layout: 'fit', - width: 600, - height: 400, + Ext.apply(me, { items: grid, buttons: [ submitBtn ] }); @@ -193,7 +192,10 @@ Ext.define('PVE.storage.Upload', { xtype: 'filefield', name: 'filename', buttonText: gettext('Select File...'), - allowBlank: false + allowBlank: false, + buttonConfig: { + height: 32 + } }, pbar ] @@ -298,7 +300,7 @@ Ext.define('PVE.storage.Upload', { submitBtn.setDisabled(!valid); }); - Ext.applyIf(me, { + Ext.apply(me, { title: gettext('Upload'), items: me.formPanel, buttons: [ abortBtn, submitBtn ], @@ -334,7 +336,7 @@ Ext.define('PVE.storage.ContentView', { } var baseurl = "/nodes/" + nodename + "/storage/" + storage + "/content"; - var store = new Ext.data.Store({ + var store = Ext.create('Ext.data.Store',{ model: 'pve-storage-content', groupField: 'content', proxy: { @@ -487,7 +489,7 @@ Ext.define('PVE.storage.ContentView', { } ], listeners: { - show: reload + activate: reload } });