[pmg-devel] [PATCH pmg-gui 2/2] RegexTester: find correct component

Stoiko Ivanov s.ivanov at proxmox.com
Thu Nov 12 18:57:57 CET 2020


the regular expression field is not necessarily after the regex tester
(mostly it is before). In order to be more robust, use child instead of
previousSibling

Tested with:
* mailproxy whitelist
* match field
* match filename
* who object

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
Thanks to Dominik for pointing me in the right direction!

 js/RegexTester.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/RegexTester.js b/js/RegexTester.js
index 3b03f6d..486c197 100644
--- a/js/RegexTester.js
+++ b/js/RegexTester.js
@@ -26,7 +26,7 @@ Ext.define('PMG.RegexTester', {
 	    text: 'Test',
 	    handler: function(btn) {
 		let view = this.up();
-		let regexField = btn.nextSibling(`field[reference=${view.regexFieldReference}]`);
+		let regexField = view.up().child(`field[reference=${view.regexFieldReference}]`);
 
 		let regex = regexField.getValue();
 		if (view.wholeMatch) {
-- 
2.20.1





More information about the pmg-devel mailing list