[pve-devel] [PATCH manager v7 14/14] ui: form/Tag(Edit): add drag & drop when editing tags

Aaron Lauterer a.lauterer at proxmox.com
Wed Sep 14 16:15:19 CEST 2022



On 6/21/22 11:20, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>   www/manager6/form/Tag.js     | 22 +++++++--
>   www/manager6/form/TagEdit.js | 96 +++++++++++++++++++++++++++++++++++-
>   2 files changed, 114 insertions(+), 4 deletions(-)
> 
> diff --git a/www/manager6/form/Tag.js b/www/manager6/form/Tag.js
> index 91190051..dcbd9597 100644
> --- a/www/manager6/form/Tag.js
> +++ b/www/manager6/form/Tag.js
> @@ -31,6 +31,9 @@ Ext.define('Proxmox.Tag', {
>   	if (event.target.tagName !== 'I') {
>   	    return;
>   	}
> +	if (event.target.classList.contains('handle')) {
> +	    return;
> +	}
>   	switch (me.mode) {
>   	    case 'editable':
>   		if (me.addTag) {
> @@ -156,12 +159,14 @@ Ext.define('Proxmox.Tag', {
>   	let text = me.tag;
>   	let cursor = 'pointer';
>   	let padding = '0px';
> +	let dragHandleStyle = 'none';
>   	switch (mode) {
>   	    case 'normal':
>   		iconStyle += 'display: none;';
>   		padding = undefined;
>   		break;
>   	    case 'editable':
> +		dragHandleStyle = '';

Is there a reason for the '' here compared to the 'none' above and below?

>   		break;
>   	    case 'edit':
>   		me.tagEl().contentEditable = true;
> @@ -174,12 +179,14 @@ Ext.define('Proxmox.Tag', {
>   	if (me.addTag) {
>   	    me.setText(text);
>   	    me.setStyle('cursor', cursor);
> +	    dragHandleStyle = 'none';
>   	}

[...]





More information about the pve-devel mailing list