Commit Graph
6 Commits
Author SHA1 Message Date
Romeo Fragomeli 5f454f0ccb [IMP] web,web_editor,website_slide: sortable service for frontend usage
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.

The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).

```javascript
// start / setup
const sortable = this.call(
    "sortable",
    "create",
    {
        ref: { el: document.querySelector(".list") },
        elements: ".items",
        handle: ".drag-icon",
    },
);

// on attach callback / on mounted
const sortableInstance = sortable.enable();

// on destroy / on willUnmount
sortableInstance.cleanup();
```

Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse

task-3439226

closes odoo/odoo#137527

Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-10 01:59:35 +00:00
Pierre Paridans 25d0783b59 [IMP] web: reduce jquery-ui lib (remove useless modules)
Includes: widget.js, position.js, data.js, keycode.js, scroll-parent.js,
unique-id.js, widgets/draggable.js, widgets/droppable.js,
widgets/sortable.js, widgets/autocomplete.js, widgets/menu.js,
widgets/mouse.js

task-3439226

closes odoo/odoo#135491

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-15 10:48:28 +00:00
David Monjoie c8bab2ddb3 [REF] web: update jquery.ui to v1.12.1 2019-03-06 19:49:01 +01:00
Christophe Simonis 4b542b0484 [~MERGE] forward port of odoo/enterprise branch saas-10 up to odoo/enterprise@5ca7d8bc31
NOTE: all .po files haven't been forward-ported due to conflicts. Once
.pot updated, the auto-match of transifex should get them back.
2016-05-04 17:10:00 +02:00
Christophe Matthieu a56f27a3c9 [IMP] web: reduce jquery-ui lib (remove useless modules)
Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, sortable.js, autocomplete.js, datepicker.js, menu.js, tooltip.js
2016-02-17 09:47:46 +01:00
Simon Lejeune 74ed4b276d [IMP] web: update jquery-ui to 1.11.2 version 2014-12-19 17:49:12 +01:00