Commit Graph
4 Commits
Author SHA1 Message Date
abd-msyukyu-odoo 74753681ee [FIX] web: fix dragging a nest in article tree
When dragging an article with an open nest, the `jquery.mjs.nestedSortable`
library does not refresh the positions of the following articles. This forces
the user to drag the nest far below the target position to move the placeholder.

This commit is a small fix to the library, to refresh said positions before
checking for element intersection.

Task-2883290

closes odoo/odoo#95749

Related: odoo/enterprise#29315
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-14 16:42:01 +02:00
abd-msyukyu-odoo 4272e239de [FIX] web: prevent flickering when moving an article down
Prevent a flickering effect when dragging item down in a nested tree using the
`jquery.mjs.nestedSortable` library.

Situation:

1.) start dragging, moving down and slightly to the left

.dragged item
.nest0
  .nest00
    .nest000

2.) intersect nest0

.nest0:hover:.dragged item
  .nest00
    .nest000
.drop destination

3.1.LIBRARY) intersect nest00 first trigger

.nest0
  .nest00:hover:.dragged item
    .nest000
  .drop destination (frame 1)

3.2.LIBRARY) intersect nest00 second trigger (slightly below and to the left)

.nest0
  .nest00:hover:.dragged item
    .nest000
.drop destination (frame 2)

frame 1 and frame 2 are rendered almost simultaneously, and in a cycle (after
3.2. comes 3.1. again), resulting in a flickering effect.

3.1.FIXED) intersect nest00

.nest0
  .nest00:hover:.dragged item
    .nest000
.drop destination

drop destination is not allowed to go UP in the dom since the mouse is lower
than before. No flickering in this case.

To go up in the tree, the user can simply move the cursor to the right and/or
up.

The `jquery.mjs.nestedSortable` library will be rewritten internally in the
future to remove the jQuery dependency, but this fix allows a smooth utilisation
in the meantime.

Task-2883290

Part-of: odoo/odoo#95749
2022-07-14 16:42:01 +02:00
Martin Geubelle aa19d9edd0 [REF] web: update nestedSortable lib 1.3.5 -> 2.1a 2016-09-28 16:55:51 +02:00
Adrien Dieudonne 3029857bad [REF] web, website: move jQuery UI Nested Sortable lib
As this lib will be used in the backend, it is moved to assets common.
2016-09-01 14:06:21 +02:00