]> git.proxmox.com Git - pve-manager.git/commitdiff
copy form/ContentTypeSelector.js from manager to manager5
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jul 2015 09:29:11 +0000 (11:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jul 2015 09:29:11 +0000 (11:29 +0200)
www/manager5/form/ContentTypeSelector.js [new file with mode: 0644]

diff --git a/www/manager5/form/ContentTypeSelector.js b/www/manager5/form/ContentTypeSelector.js
new file mode 100644 (file)
index 0000000..0c74524
--- /dev/null
@@ -0,0 +1,22 @@
+Ext.define('PVE.form.ContentTypeSelector', {
+    extend: 'PVE.form.KVComboBox',
+    alias: ['widget.pveContentTypeSelector'],
+  
+    cts: undefined,
+
+    initComponent: function() {
+       var me = this;
+
+       me.data = [];
+
+       if (me.cts === undefined) {
+           me.cts = ['images', 'iso', 'vztmpl', 'backup', 'rootdir'];
+       }
+
+       Ext.Array.each(me.cts, function(ct) {
+           me.data.push([ct, PVE.Utils.format_content_types(ct)]);
+       });
+
+       me.callParent();
+    }
+});