]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
copy grid/SelectFeature.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/grid/SelectFeature.js [new file with mode: 0644]

diff --git a/www/manager5/grid/SelectFeature.js b/www/manager5/grid/SelectFeature.js
new file mode 100644 (file)
index 0000000..f0d2acd
--- /dev/null
@@ -0,0 +1,35 @@
+Ext.override(Ext.view.Table, {
+    afterRender: function() {
+        var me = this;
+        
+        me.callParent();
+        me.mon(me.el, {
+            scroll: me.fireBodyScroll,
+            scope: me
+        });
+       if (!me.featuresMC ||
+           (me.featuresMC.findIndex('ftype', 'selectable') < 0)) {
+            me.el.unselectable();
+       }
+
+        me.attachEventsForFeatures();
+    }
+});
+
+Ext.define('PVE.grid.SelectFeature', {
+    extend: 'Ext.grid.feature.Feature',
+    alias: 'feature.selectable',
+
+    mutateMetaRowTpl: function(metaRowTpl) {
+       var tpl, i,
+       ln = metaRowTpl.length;
+       
+       for (i = 0; i < ln; i++) {
+           tpl = metaRowTpl[i];
+           tpl = tpl.replace(/x-grid-row/, 'x-grid-row x-selectable');
+           tpl = tpl.replace(/x-grid-cell-inner x-unselectable/g, 'x-grid-cell-inner');
+           tpl = tpl.replace(/unselectable="on"/g, '');
+           metaRowTpl[i] = tpl;
+       }
+    }  
+});