Commit Graph
2348 Commits
Author SHA1 Message Date
Nicolas Bayet 51e6b349e3 [FIX] web_editor: open the linktool when clicking an element inlide link
Whenever we clicked on a link that contained another element
(eg. span, bold, ...), the LinkTool did not open.

Task-2667989

closes odoo/odoo#83437

X-original-commit: d69d26a2dd8830aca8c5922d3548e5ff59c688fc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-26 18:23:56 +00:00
Nicolas Bayet 84df34daa2 [FIX] web_editor: resolve ajax request of cleanForSave
Upon save in website or in mass_mailing, if a `cleanForSave` of a
`SnippetEditor` or a `SnippetOption` wait for the end of an
`this._rpc()` request AND the `SnippetEditor` or the `SnippetEditor`
of the `SnippetOption` has a `SnippetEditor` ancestor, the
`cleanForSave` will never resolve.

Here is the scenario:

- **SnippetEditor B** has **SnippetEditor A** as its odoo widget parent

In `SnippetMenu` `_destroyEditors`:
- **SnippetEditor A** and **all its SnippetOption** call `cleanForSave`.
- **SnippetEditor B** and **all its SnippetOption** call `cleanForSave`.
  One of the promise of **SnippetEditor B** includes the result of
  `rpc()` in `ajax_service.js`.

- **SnippetEditor A** and **all its SnippetOption**
  `cleanForSave promises` resolve (but not **SnippetEditor B**).
- **SnippetEditor A** get's destroyed (`snippetEditor.destroy()`). As
**SnippetEditor B** is a `Widget` child of **SnippetEditor A**:
- **SnippetEditor B** get's destroyed (here is where the problem start).

... in the mean time ...

The ajax request of a promise of **SnippetEditor B** ends. The promise
of the `rpc()` will never finish because **SnippetEditor B** is
destroyed and the condition in `rpc()` is:
```js
if (!target.isDestroyed()) {
    resolve(result);
}
```

Because the promise will never finish for `_destroyEditors`, the save
action will never fully complete.

Task-2742008

Part-of: odoo/odoo#83103
2022-01-26 14:08:47 +00:00
Nicolas Bayet 013f0da147 [FIX] web_editor: properly save history step when pasting text
Before this commit, when trying to paste an url, the editor was
properly creating a link but did not create a step in the history.
So when the user hit enter just after the paste, the last link
insertion was reverted.

Task-2720366

closes odoo/odoo#83396

X-original-commit: 0e37742d3caba1c6544e5b466503f155626375eb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-26 13:11:14 +00:00
qsm-odoo e4e69d54fb [FIX] website, web_editor: prevent traceback on popup removal
Before this commit, a traceback occured when trying to remove a popup
snippet, only if content inside was clicked on before (base case but
that last part was not covered by our main test which drags and drops +
removes all snippets).

The problem is complex and annoying to solve in stable. The cause is the
combination of [1] and [2]. Indeed, with [2] we solved the snippet
activation flow to ensure the onFocus and onBlur methods are called when
needed... but that new correct implementation relies on the fact that
the number of snippet editor instances does not change for the whole
async operation of activating a snippet. That should naturally be the
case but is not because of [1]: when we remove a snippet we first
trigger a snippet activation then destroy the snippet (and its editor
instance)... but the snippet activation is not awaited at the moment.
Thus making the snippet editor instance be destroyed *during* the
snippet activation flow. Of course a better solution than this commit
must be found but this fixes the traceback with a very minimal change
for the 15.0 stable version while waiting for that miraculous solution.

[1]: https://github.com/odoo/odoo/commit/ae219ec06baf0280c76ae09b1453cc1481eece30
[2]: https://github.com/odoo/odoo/commit/0acc5e784b15d9c963660da3781763448503f33e

task-2735663

closes odoo/odoo#83378

X-original-commit: da7c1b5757a7780897c5736ddecc014a7fb50bdb
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-26 13:11:10 +00:00
Benoit Socias 9943931c6f [FIX] web_editor: remove gradient background image when removing format
Before this commit the removeFormat command was only doing its default
native implementation, which did not clean the background-image CSS
property. Because of this, text-gradients became highlight gradients.

After this commit in addition to the default native implementation, the
removeFormat also clears the background-image CSS property.

Steps to reproduce:
- edit the website homepage
- drop a text snippet
- enter a new line of text
- set a text gradient on the new line
- switch the new line to Heading 1
=> new line has the gradient used as background

task-2741684 (was part of task-2666200)

closes odoo/odoo#83306

X-original-commit: 97da1c2106d2a0e76dff1353e56b74d70db55eb2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-25 12:19:22 +00:00
Guillaume (gdi) 109f34d13e [FIX] web_editor: fix media link tool activation
Before this commit, the shortcut activated the link tool on all images
in the section. This commit permits to activate the link tool only on
the target image.

task-2666467

closes odoo/odoo#83295

X-original-commit: ebeeaf492285c9c1c9d9fd6e359dca27ee315021
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-01-25 09:57:19 +00:00
Guillaume (gdi) d88431961c [FIX] web_editor: support media link tool shortcut on firefox
The CTRL + K shortcut to activate the media link tool did not worked on
firefox. This commit fixes that.

task-2666467

X-original-commit: 13375c5f079597abadb77ba5e17bc2087f6c24fc
Part-of: odoo/odoo#83295
2022-01-25 09:57:19 +00:00
Antoine Guenet 76cf71a86f [REF] web_editor, mass_mailing: rename wysiwyg "intance" typo functions
This properly renames the functions _createWysiwygIntance and
_restartWysiwygIntance to, respectively, _createWysiwygInstance and
_restartWysiwygInstance since they both had a typo in them and it's
triggering all of our OCDs.

closes odoo/odoo#83098

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 16:55:20 +00:00
Guillaume (gdi) 36258053c5 [FIX] web_editor: clean media link tool for master
As we added the media link tools in a stable release (15.0) with [1], we
had to make all the changes in static files (JS and lazy loaded XML).
We don't have to worry about that in master so the code is simplified
with this commit.

[1]: https://github.com/odoo/odoo/commit/bfcd25c5d66765b7436114dba3316ac7331a4d97

task-2666467

closes odoo/odoo#78578

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-01-24 16:05:49 +00:00
Antoine Guenet c82c38b178 [FIX] web_editor, mass_mailing: fix 0 dimensions of img when not visible
The conversion process of emails for mail clients involves retrieving
the dimensions of images and icons in order set them as element
attributes. This can however not possibly work if they are invisible at
the time of conversion. This therefore makes sure they are visible by
changing the visibility of whichever parent was invisible before
conversion and restoring it when we're done.

opw-2686316
opw-2735636

closes odoo/odoo#83233

Related: odoo/enterprise#23695
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 15:09:27 +00:00
Antoine Guenet fd0c0976c2 [FIX] web_editor: properly convert img dimensions
Images sometimes shrunk on conversion because of a parenthesis error in
a conditional chain, because dimensions set via element attributes
should be preserved, and because the offset height should be
used rather than the element height as returned by jQuery.

Part-of: odoo/odoo#83233
2022-01-24 15:09:27 +00:00
Antoine Guenet e641575150 [FIX] web_editor: properly apply padding in tables
The conversion of padding from grids to their equivalent
tables was sometimes faulty due to an error in the
evaluation of the cell's position within the table.

Part-of: odoo/odoo#83233
2022-01-24 15:09:27 +00:00
Antoine Guenet 1013b63571 [FIX] web_editor: properly convert cards to tables
Cards need to be double wrapped in tables to be
displayed properly because of a bizarre hack by
bootstrap that uses background-color rather to give
the effect of a border, and because we can have
card-body be a sibling of a list-group.
Incidentally this also prevents the introduction of a
new row for each whitespace text node.

Part-of: odoo/odoo#83233
2022-01-24 15:09:27 +00:00
Antoine Guenet cc90b972f8 [FIX] web_editor: prevent useless tbodys on convert
When converting, we ensure each table has a tbody
but inadvertently were wrapping each <tr> in a
separate tbody rather than wrapping all the contents
of the table.

Part-of: odoo/odoo#83233
2022-01-24 15:09:26 +00:00
Antoine Guenet badd8922f7 [FIX] mass_mailing: ensure body_arch and body_html have the same fonts
The mail-safe font is applied to a style in <head> for emails. But the
way it was applied, <div>s were forgotten. Since most of those are
converted to tables when converting body_arch to body_html, it resulted
in visible font differences between body_arch and body_html.

Part-of: odoo/odoo#83233
2022-01-24 15:09:26 +00:00
Antoine Guenet fcc220c336 [FIX] web_editor: prevent cropping fonts->images on apply padding
When fonts with a round border were converted to images, the dimensions
often ended up slightly off, and most visibly a little bit cropped by
the border.

Note that this also removes the "alpha" argument of the font_to_img
route since it wasn't used anywhere and transparency is not supported in
emails anyway.

Part-of: odoo/odoo#83233
2022-01-24 15:09:26 +00:00
Antoine Guenet 3fb6eee447 [FIX] web_editor: round conversion from grid to percentage to 2 decimals
When converting from grid to tables, we need to convert values from x/12
to x/100. The rounding error was a little too big, making it too visible
at times. With this commit we now round to 2 decimal places instead of
rounding to the nearest integer.

Part-of: odoo/odoo#83233
2022-01-24 15:09:25 +00:00
Antoine Guenet fba1aee5dd [FIX] web_editor: properly preserve exact font size
The conversion from rem to px was rounding the value to 1 decimal place
but the browser handles up to 2 decimal places. As a result there were
visible inconsistencies in the conversion (12.25px in the original
becoming 12.3px in the converted email).

Part-of: odoo/odoo#83233
2022-01-24 15:09:25 +00:00
Antoine Guenet a1915ab986 [FIX] web_editor: properly convert table cell/row alignment
The align-self and justify-content styles don't work on cells so when
converting a Bootstrap column to a table cell, we should also apply a
vertical alignment. The same applies to align-items on rows.

Part-of: odoo/odoo#83233
2022-01-24 15:09:25 +00:00
Nicolas Bayet eca0fe7450 [FIX] web_editor: allow to select inside a button when editing
When the user-select is none in firefox, it is impossible to select the
text even if the content is editable.

Task-2716365

closes odoo/odoo#83255

X-original-commit: 88a5269b2130bc82c48bc587a042c24062bc4e96
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 14:13:49 +00:00
Antoine Guenet 93151fb73b [FIX] web_editor: properly apply color in nested inline contexts
The colorpicker failed in cases like:
```xml
<font>a<span>b</span>c</font>
```
where we select the letter "b".
This was because `applyColor` only considered direct children of the
`font` element. This extends it to deal with further descendants of it.

task-2623347

closes odoo/odoo#83254

X-original-commit: 5d8d98812a4f351abd27389c4992bf9e753833b7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 14:13:45 +00:00
Antoine Guenet c616f38f77 [FIX] web_editor: display current text color in text color button
The editor toolbar button to trigger the colorpicker is supposed to show
the color of the currently selected text. This was failing in iframes
because the code was called on the wrong document.

task-2623347

X-original-commit: 7ad6536dd98f9749d63bfc7292e490f6ac629b9c
Part-of: odoo/odoo#83254
2022-01-24 14:13:45 +00:00
Nicolas Bayet a565e73574 [FIX] web_editor: properly position the toolbar
In some undetermined circumstance in chrome, the selection rect is
wrongly defined.

Task-2728792

closes odoo/odoo#83248

X-original-commit: e9ee8175538e1201acb2ae108b2283f55217ca5f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 13:19:49 +00:00
Antoine Guenet f02b15dcc2 [FIX] web_editor: restore rules cache
This commit restores the cache on the document that was lost with the
new parsing system [1]. It allows for faster convertion to inline styles
after the first time on the same document.

[1] https://github.com/odoo/odoo/commit/10e749537186dfb80aee1f2537f3b5804f66cfe5#diff-5922d38ff6520249ff5b3a3240eebc350c6f9f4d9f486d512128c23261c45841L19

closes odoo/odoo#83139

X-original-commit: 0ee96727793cfa64c9cdb9f3ef3b7e6b1ef1f631
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-24 07:41:52 +00:00
Antoine Guenet 171ae90cd0 [FIX] web_editor, mass_mailing: speed up opening of field html inline
On opening field html with the inline styles option we were parsing all
the css in the page. This should only be needed when we save. This
commit moves the call to `getCSSRules`back to `commitChanges`.

closes odoo/odoo#83131

X-original-commit: 0d4342317d456ed37f0bf24f00538ef54f847e60
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-21 16:49:54 +00:00
Antoine Guenet 2093aefbe8 [FIX] web_editor: remove check ids in tests
The random ids of checklists and stars are preserved in the dom, which
is needed for their readonly check features to work. However, it
complicates testing. This systematically removes these ids in tests.
It also removes the ids when they are not needed anymore (the node is
not a checklist anymore for instance).

closes odoo/odoo#83137

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-21 15:04:09 +00:00
David Monjoie 5474c8b1df [REV] web_editor: revert prevent editor powerbox hint duplication
This reverts bfed1edd26312488dc0f45e8982b51ea4d98db76.

That commit had issues which were hidden by the fact that tests had an
only in them due to a prior mistaken commit. Therefore, it must be
reverted as a proper fix needs to be found.

X-original-commit: 22c2a9dca29adcad84072e3f053ab78b7834f4f3
Part-of: odoo/odoo#83137
2022-01-21 15:04:09 +00:00
David Monjoie d2d763f30e [FIX] web_editor: fix lingering only in tests
X-original-commit: 47dc1639ab18ae9080fc4a7a3c2822c4cce2175a
Part-of: odoo/odoo#83137
2022-01-21 15:04:08 +00:00
Nicolas Lempereur 96ec641217 [FIX] web_editor: no !important bg-color
The tool to change background color in mass mailing will currently
set the CSS property as !important.

On outlook software (or windows mail app) this seems to fail:

- !important on inline CSS should not be used

In this fix we remove !important when inlining CSS.

opw-2641343

note: this forward-port is only taking half of 14.0 d7e5101603 since the
issue of targetting DIV elements does not apply here (the <div/> with
the background color are transformed in table in convert_inline.js).

closes odoo/odoo#82924

X-original-commit: fb675251ce8b13d36dfac7a50e9b1cea4759cc02
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-01-19 10:30:52 +00:00
Thibault Libioulle 54c5160264 [IMP] website_sale: search tag in product snippet
This commit adds a search on tag in product snippet.

task-2675384

closes odoo/odoo#79296

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-17 14:07:46 +00:00
Nicolas Bayet b467e4df8c [FIX] web_editor: remove image toolbar when removing image
Task-2728793

closes odoo/odoo#82881

X-original-commit: 0ff6f919e10388f7fd6d8efbfb0c8f9644b2505e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:31 +00:00
Nicolas Bayet 48045a069b [FIX] web_editor: change fix for scrolling powerbox
The fix to add an `overflow: hidden` in order to prevent the browser
from chaning the scroll create a glitch where the scrollbar dissapear
when it is overflow: hidden.
A new css property exists to specify exactly this behavior
(`overscroll-behavior: contain;`).

Task-2728791

closes odoo/odoo#82880

X-original-commit: 4cfa9e786d41a27d1bc850eff4fc89e1c4b32974
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:28 +00:00
Guillaume (gdi) 3dde03308d [IMP] web_editor, website: add placeholder and undeletable on we-list
This commits introduces new behaviors on the we-list:
1. Possibility to add a placeholder on inputs
2. Possibility to make elements non deletable
3. Possibility to make element activated/toggled by default
4. Possibility to generate ID for new elements

task-2687447

Part-of: odoo/odoo#80217
2022-01-16 23:36:46 +00:00
Benoit Socias 48a60fe268 [FIX] web_editor: discard background positioning when clicking outside
Since [1] options could still be used while a background positioning
overlay was opened.

After this commit the overlay is deactivated whenever an element outside
of it is clicked - as initially intended.

[1] https://github.com/odoo/odoo/commit/dfd98f49e7f2ab5c94dcae3af2d14750d301fa0a

task-2735690

closes odoo/odoo#82824

X-original-commit: 574ae49acb950d99ef4ab2b0504cfd7f39bca406
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-16 16:48:50 +00:00
Nicolas Bayet d3b328358f [FIX] web_editor: prevent editor powerbox hint duplication
Whenever the browser is lagging between multiple enter,
the command hints were not being updated until the browser
main thread process the event queue.

Task-2728794

closes odoo/odoo#82795

X-original-commit: bfed1edd26312488dc0f45e8982b51ea4d98db76
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 16:37:54 +00:00
Antoine Guenet dc17e84778 [IMP] web_editor: prevent icon and text tools in stars widget
When clicking, double clicking or triple clicking in the stars widget of
the Powerbox, we don't want to see the regular options of icons or text.
This prevents them from showing.

task-2575449

closes odoo/odoo#81920

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 10:21:31 +00:00
Antoine Guenet d6688ca759 [ADD] web_editor: allow rating with stars in readonly fields
Similar to checklists, this allows the user to click the powerbox stars
widget even in readonly mode, so as to change a rating without going in
edit mode.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 199874c963 [REF] web_editor: change field html widget to modern module
This adapts the html field widget so it uses the modern import system
rather than the old `require`.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 41e98ccbe4 [FIX] web_editor: check/uncheck checkboxes in readonly fields
When a checklist is present in an html field, there is a feature that
allows us to check/uncheck its boxes without going through edit mode.
That feature was broken due to a dead callback in wysiwyg.js, which is
hereby restored.
Meanwhile, the behaviour of checklists had changed but the python code
handling the readonly checking/unchecking hadn't so this brings it up to
date[1].
Finally, the code managing checklist ids was unnecessarily complicated
as it was trying to keep the ids consecutive for no particular reason.
This refactors it to simply use unique ids based on date stamps.

[1] It used to be that checking a box checked all the children of that
box but it was in the meantime decided not to do that anymore.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 8266b978e1 [ADD] web_editor: two new powerbox widgets to rate with 3 or 5 stars
This adds two new widgets to the powerbox, which allow the user to
quickly insert 3 or 5 stars, then click on them to color them gold.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:29 +00:00
Nicolas Bayet 89c215983b [REF] web_editor: remove dead code
closes odoo/odoo#82742

X-original-commit: a101ead524148825c99a4032a50138140527365a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:50 +00:00
Nicolas Bayet f4b76e99ef [FIX] web_editor, mass_mailing: create link in new tab
In mass_mailing, creating a link from the linktool in mass mailing
generated link that would not create a new tab when clicked.

Task-2734760

closes odoo/odoo#82735

X-original-commit: c6b7556a35182174c3384c2069256826205bba22
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:42 +00:00
Nicolas Bayet 45cc8fa5a1 [FIX] web_editor: postprocess snippet once added through powerbox
Whenever adding a snippet from the powerbox, the postprocessing was not
made. This could result in unexpected behavior of the snippet.

Task-2601600

closes odoo/odoo#82694

X-original-commit: bcbf8e59c83200cb079ef15cb1fa5f7783023d88
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-13 12:47:12 +00:00
Benoit Socias bb015c4bdb [FIX] web_editor: disable command hints on navigation items
Before this commit a "List" command hint was set as placeholder in
navigation items without content upon selection of the header menu. This
showed up when using the sidebar template of the header menu.

After this commit the command hints are blacklisted for nav-items in
website.

task-2677310

closes odoo/odoo#82693

X-original-commit: e0cc23b44d798a5bf79d3e8f7e183f5e8a3c6901
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-13 12:47:08 +00:00
Guillaume (gdi)andqsm-odoo 7c8323e816 [FIX] web_editor, website: permit the user to set link on images
This restores a (basic) feature that was lost in 15.0 by mistake.

Allow the user to set a link on an image. The user can access this link
tool in the editor panel or via the CTRL+K shortcut. This tool is very
similar to the existing link tool for texts. This tool uses the
suggestion system already existing on the text link tool.

task-2666467

closes odoo/odoo#82512

X-original-commit: bfcd25c5d66765b7436114dba3316ac7331a4d97
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-01-11 14:27:00 +00:00
Guillaume (gdi)andqsm-odoo 5957cad422 [FIX] web_editor: ensure order of the we-input events
This commit ensures that changes are applied in the same order as the
events are triggered on the InputUserValueWidget. This was not the case
because of another bug we had to consider and which is not there
anymore, this is why this fix is done in 15.0 and not before.

Actually, this also greatly improves the inputs behavior using the
natural "change" event which occurs... when a change was made. Before,
if you hit enter 5 times then left an input, you had the option applied
6 times (which was particularly annoying for options which reload assets
like the header border or something like that).

task-2666467

X-original-commit: db62a5fac123fc72e37e94709b1a0c80f32a8a29
Part-of: odoo/odoo#82512
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-01-11 14:27:00 +00:00
qsm-odoo 3490b998ee [FIX] web, *: fix the grab cursor not working on all browsers
*: web_editor, point_of_sale, pos_restaurant

The grab cursor is currently not working on all browsers (at least
Chrome Linux). The fallback rule does not even work, meaning that if
you type:

```
cursor: move;
cursor: grab;
```

Those browsers does not even use "move" as they see "grab" as valid but
use the "default" cursor.

This commit replaces our "grab" uses with a local cursor ensuring it
works.

Related to task-2431469

closes odoo/odoo#82093

X-original-commit: 23ebcca902781f2fa0f2381997be4f3d375385b5
Related: odoo/enterprise#23193
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-03 18:58:41 +00:00
Younn Olivierandqsm-odoo 30682fd44c [FIX] web_editor: remove rename button from custom snippet on drag
Commit [1] added a rename button for custom snippets... but forgot to
remove it once the snippet is being dragged.

[1]: https://github.com/odoo/odoo/commit/1044a76a19d94ce93c4cd41841fb805d36a160e3

closes odoo/odoo#82080

X-original-commit: 2d81a6e4a1a8ebb915f00bf37267fb445b7027b7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-30 15:15:37 +00:00
qsm-odoo 29e5516e2a [FIX] web_editor: re-encourage to use snippets in empty oe_structure
This commit re-applies the commit that was merged at [1] but whose
code was lost during Jabberwock revert at [2].

Make the draggable snippets "wizz" when the user clicks on an empty
oe_structure.

[1]: https://github.com/odoo/odoo/commit/3ed3537abd416ebc35f8bc2ee65f209840c071bf
[2]: https://github.com/odoo/odoo/commit/e5572c317a7775a58675ed73efc89b5c9f6c0c39

Related to task-2363616

closes odoo/odoo#82046

X-original-commit: 668539aa17f061c8851099863e4d5fb7b11b59e8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-30 11:16:11 +00:00
Younn Olivierandqsm-odoo 116afad9fa [FIX] web_editor: correctly move snippets on a popup
Inside a scrollable popup, the scroll was not correctly triggered when
moving one of its snippets through drag and drop.

This commit correctly defines the SmoothScrollOnDrag.$scrollTarget when
a modal is shown.

task-2431469

closes odoo/odoo#82040

X-original-commit: 844051168311ac0c3e8640dda2a90545e373c98d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-30 11:16:08 +00:00