[pve-devel] [PATCH manager 2/2] ui: storage/PBS edit: eslint fixes

Dominic Jäger d.jaeger at proxmox.com
Wed May 19 11:14:19 CEST 2021


Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
 www/manager6/storage/PBSEdit.js | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
index 2479304a..773d41e8 100644
--- a/www/manager6/storage/PBSEdit.js
+++ b/www/manager6/storage/PBSEdit.js
@@ -372,7 +372,6 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 			return true;
 		    },
 		    afterRender: function() {
-			let field = this;
 			if (!window.FileReader) {
 			    // No FileReader support in this browser
 			    return;
@@ -383,15 +382,12 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 				ev.preventDefault();
 			    }
 			};
-			field.inputEl.on('dragover', cancel);
-			field.inputEl.on('dragenter', cancel);
-			field.inputEl.on('drop', function(ev) {
-			    ev = ev.event;
-			    if (ev.preventDefault) {
-				ev.preventDefault();
-			    }
-			    let files = ev.dataTransfer.files;
-			    PVE.Utils.loadTextFromFile(files[0], v => field.setValue(v));
+			this.inputEl.on('dragover', cancel);
+			this.inputEl.on('dragenter', cancel);
+			this.inputEl.on('drop', ev => {
+			    cancel(ev);
+			    let files = ev.event.dataTransfer.files;
+			    PVE.Utils.loadTextFromFile(files[0], v => this.setValue(v));
 			});
 		    },
 		},
-- 
2.20.1






More information about the pve-devel mailing list