public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui] fix #2844: MailTracker: do not collapse rows with double click
Date: Wed, 15 Jul 2020 12:32:37 +0200	[thread overview]
Message-ID: <20200715103237.24814-1-d.csapak@proxmox.com> (raw)

so that users can select words with double click, but can still expand
the logs with it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
not sure about it, since the user now cannot collapse the log
with doubleclick anymore...

 js/MailTracker.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/js/MailTracker.js b/js/MailTracker.js
index 34b6d6f..9cd2b9f 100644
--- a/js/MailTracker.js
+++ b/js/MailTracker.js
@@ -245,6 +245,7 @@ Ext.define('PMG.MailTracker', {
     plugins: [
 	{
 	    ptype: 'rowexpander',
+	    expandOnDblClick: false,
 	    rowBodyTpl: '<p class="logs">{logs}</p>'
 	}
     ],
@@ -309,9 +310,23 @@ Ext.define('PMG.MailTracker', {
 	    });
 	},
 
+	// only expand row on dblclick, but do not collapse
+	expand: function(view, record, row, rowIdx, e) {
+	    // inspired by RowExpander.js
+	    let rowNode = view.getNode(rowIdx);
+	    let normalRow = Ext.fly(rowNode);
+
+	    let collapsedCls = view.rowBodyFeature.rowCollapsedCls;
+
+	    if (normalRow.hasCls(collapsedCls)) {
+		view.rowBodyFeature.rowExpander.toggleRow(rowIdx, record);
+	    }
+	},
+
 	control: {
 	    'gridview': {
-		expandbody: 'showDetails'
+		expandbody: 'showDetails',
+		itemdblclick: 'expand',
 	    }
 	}
     },
-- 
2.20.1





             reply	other threads:[~2020-07-15 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 10:32 Dominik Csapak [this message]
2020-09-23  7:04 ` [pmg-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200715103237.24814-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal