Commit Graph
2618 Commits
Author SHA1 Message Date
Ravi Singh 5e7230b6bb [FIX] web_editor: remove useless 'o_small' style for colors
task-2151416

closes odoo/odoo#41473

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-06 13:18:05 +00:00
qsm-odoo 864cb9132d [REF] web_editor: do not select left panel input content automatically
Part of https://github.com/odoo/odoo/pull/41402

closes odoo/odoo#41402

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-06 10:05:55 +00:00
qsm-odoo 83fae16bb9 [REF] web_editor: review user value widgets scss
Part of https://github.com/odoo/odoo/pull/41402
2019-12-06 10:05:55 +00:00
qsm-odoo a41717bebf [IMP] web_editor: add left panel input on a new line by default
Before this commit, inputs were always a title followed by the <input/>
on the same line.

Now it follows the same logic as we-row elements: title on a line,
<input/> on a new line, except if the 'o_we_inline' class is used.

Part of https://github.com/odoo/odoo/pull/41402
2019-12-06 09:45:30 +00:00
qsm-odoo e4d4aab042 [IMP] web_editor: validate input entry with ENTER in editor left panel
Especially useful with a no-preview input.

Part of https://github.com/odoo/odoo/pull/41402
2019-12-06 09:45:30 +00:00
Samuel Degueldre 65262c5e3e [IMP] web_editor: allow options to target subelements of a snippet
Add the ability for a snippet option's method to target multiple
subelements of the option's $target using the data-apply-to attribute
with a jQuery selector. This is achieved by calling the method on a
proxy of the object where accesses to the $target are redirected to a
different object.

While it may seem preferable to just set the $target before calling the
method and restoring it after the call, as this would be much simpler
code, it is not possible as this breaks down under asynchronous
conditions, hence the need to operate on a proxy such that all
concurrent asynchronous operations have their own independent $target
available for their entire time of execution.

Part of https://github.com/odoo/odoo/pull/41402
2019-12-06 09:45:30 +00:00
qsm-odoo d7f4289166 [FIX] web_editor: prevent setting values of non-activable methods
closes odoo/odoo#41404

X-original-commit: 6af602fa676db19260a828a3cfd0befe3ba1ef4e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-05 10:59:48 +00:00
qsm-odoo b62b686066 [FIX] web_editor: fix some design issues with editor left panel
- Some layout broken when a scrollbar appeared
- The edit icon of background disappeared when the filename was too long

X-original-commit: d3419fed27147c92e673fb367657db8865a0d538
2019-12-05 10:59:47 +00:00
qsm-odoo 8180b46563 [FIX] web, web_editor: improve browser support for JS lazy loading
opw-2125858

closes odoo/odoo#41371

X-original-commit: d19982b7a22b04ab76c787b9adfffd24552eb5c0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-04 16:40:03 +00:00
qsm-odoo 10a467e3e1 [FIX] web_editor: resolve conflict between tests and options mutex
In a normal flux, this happen when an option is hovered and left:

1) Hover event -> the widget goes in 'preview' state and notifies a
                  preview to the option

2) The preview is received by the option and, after an internal mutex
   resolution, the option enables its methods with the widget values.

3) Leave event -> same as (1), except leaving 'preview' state

4) same as (2), except receiving a 'reset'

Everything is fine and correctly managed... except if a JS code triggers
both hover and leave events in the same execution... and this is what
tests are doing. In this case, as (2) executes after an internal mutex
resolution, the points (2) and (3) were inverted, so the widget left the
'preview' state before (2) got the widget values.

Maybe the test system has to be improved, but this commit solves the
problem for this case explicitely.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 16:00:06 +00:00
qsm-odoo 3be9ae5672 [IMP] web_editor, *: automatically update snippet option UI on focus
* website, website_blog, website_sale

Some snippet option already needed to implement this by themself and now
that they use custom widget, this is even more needed. The long-term
goal is that developers should not have to override the onFocus method
or the updateUI method but only the _computeWidgetState method.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo fdac73e99d [IMP] web_editor, *: add new user value colorpicker widget
* web, mass_mailing, website

Introduced a new sub-widget for snippet options: we-colorpicker. This
allows to retrieve a color value (either a normalized css color or a
theme color name) to be used for a snippet option method.

This commit replaces the old 'colorpicker' snippet option whose behavior
is now simply achieved by defining an xml option using a we-colorpicker
widget in combination with the 'selectStyle' standard method.

This commit also adds the possibility to control the border-color of
elements alongside their border-width. Again, just a we-colorpicker
widget in combination with the 'selectStyle' standard method.

Note: this commit reviewed what the colorpalette palette widget
notifies. This is not a cssColor and a 'isClass' flag to say if it is
a css class or not. The colorpalette always returns a color string which
can be the name of a color like 'alpha'. This is up to the caller to
check if the color string is a css color or not with isCSSColor. In the
case it is not, the related code can read the actual color by reading
the related css variable.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo 216cf93b4d [REF] web, web_editor, *: review normalization of colors
* website

Review colorpicker methods to always allow to use normalized colors.
Also factorize some code in the color palette widget.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo b38253f400 [REF] web_editor, *: use widgets for left panel components
Before this commit, the rendering of inner content of the left panel
options was handled through _buildXXXElement methods in the options
widgets. Now they are handled through sub-widgets which also handle
the user events.

Each sub-widget is notified with the string value it should hold
according to the snippet option target and methods. Each sub-widget
notifies a string value following user interactions, which snippet
options can use to adapt their target through their option methods.

The current sub-widgets introduced by this commit are (others will
follow):

1) we-button
2) we-checkbox
3) we-input
4) we-select (typically containing multiple we-button widgets)
5) we-multi (typically containing multiple we-input widget)

Following this commit only 3 standard option methods remain, which can
be used with any meaningful widget:

1) selectClass

-> Same as before + handle the old 'toggleClass' method when used with
   a checkbox-like widget.

2) selectStyle

-> Same as old setStyle, introduced recently (simply renamed)

3) selectDataAttribute

-> Handle both old selectDataAttribute and setDataAttribute, introduced
   recently

The parameters these methods received are now:
- previewMode: same as before
- widgetValue: the string value the widget currently holds
- params: additional parameters (mainly dataset of the related xml)
    + params.possibleValues (all the possible values for the method,
      meaninful for a select or a checkbox)
    + params.defaultValue (the value that the widget would give if it
      even holds no value)

When defining a method in XML, the given value is the default value.
e.g. data-select-style="34px" data-css-property="margin-top"
-> if set on any widget, allows to retrieve a value from the user to
   customize the margin-top, the default value being 34px.
   -> if used with a we-input, allow to retrieve any value and an empty
      value will be equal to 34px
   -> if used on a checkbox, allow to toggle between no value and 34px.
   -> ...

Hopefully, detailed documentation about all of this will follow. Code
documentation should already be helpful.

Last note: the _updateUI method (replacing the old _setActive) is now
async (so does all the functions calling it). In particular, the _select
method is now async.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo 75ab52af9c [REF] web_editor, *: make options in charge of their rendering
* website, website_sale

Also make the "isTopOption" method a property.

This is done in preparation of better code for coupling sub-widgets used
to retrieve user value (button, input, colorpicker, ...) to actual
change in the edited DOM through snippet options methods.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 14:07:07 +00:00
qsm-odoo 0dd1f4595b [IMP] web_editor: add new way to edit data-* on a target
Now, the editor UI can suggest options the same way as select-class but
for editing a data attribute.

Note: the public widgets are now refreshed on data attribute changes
through the select-data-attribute and set-data-attribute methods.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 14:07:07 +00:00
qsm-odoo 0b5f1fbead [FIX] web_editor: restore fa icons used in editor following lib update
Commit https://github.com/odoo/odoo/commit/ff1c35513aecef5fbc30f7c2f3834450e719714e
broke some editor icons.

closes odoo/odoo#41097

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-29 10:47:02 +00:00
David Monjoie 53323c7ce9 [FIX] web_editor: apply missing fix from saas-12.3 revert
closes odoo/odoo#41021

X-original-commit: 21c23050f100bab2c5377c37a6de40c4acf28ca8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-11-28 08:05:00 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
qsm-odoo fbdc541f9c [FIX] web_editor: read both color and bg-color to find custom ones
This was broken during the recent colorpicker refactoring.

closes odoo/odoo#40925

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-27 09:36:27 +00:00
Nicolas Lempereur 1c47f2070b [FIX] web_editor: update attribute of edition container
In most use case, when we edit the website we have a situation such as:

```
<div id="wrap" branding-attributes="...">
    <section class="mycontent">hi!</section>
</div>
```

When we modify a part, we replace all child nodes of the branded
element.

But if we had more complex content such as:

```
<div id="wrap">
    <section class="mycontent" branding-attributes="...">ho!</section>
    <t t-call-assets="web.assets_common" t-js="false" t-css="false"/>
</div>
```

we have a t-call inside the div#wrap, so branding is distributed to
child that could have attribute modified (eg. changing background).

Then if `<section/>` node is saved, the possibly modified attributes
are lost.

Without the change, the added test fails with:

 '<div class="nice">hoi</div>' not found in '...<div>hoi</div>...' :
 saved element attributes are saved excluding branding ones

opw-2122947
closes #40345

closes odoo/odoo#40830

X-original-commit: 71b20a24c40ae9daa10076ab0fd656b043819cff
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-25 18:10:30 +00:00
Mohammed Shekha 7291021152 [FIX] web_editor: traceback on saving the product
before this commit: when creating a product from frontend and editing
the product and delete image and save edition, it throws traceback,
because ir.qweb.field.image doesn't get any url and due to which it
throws traceback.

after this commit: if url is not defined in ir.qweb.field.image field
converter then return None

task-2063293

closes odoo/odoo#40638

X-original-commit: 896127a6528fa59f7f385019e296acd5db585321
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-26 05:11:50 +00:00
Nicolas Lempereur a9a2fba683 [FIX] web_editor: remove forced source mode
In e29c08969 source mode was reintroduced. Since complex template seemed
broken when it was edited, the feature of forcing source mode when there
is a `% if ` or `% set` template directive of 12.3 was reintroduced.

Since the direct breaking of the template was mostly solved with the
added line:

`options.prettifyHtml = false;`

the force source mode is not so much necessary and there was report that
it was not very clear.

In this commit it is removed, and if necessary could be reintroduced
later with clearer implementation.

opw-2123730
fix #40410
closes #40421

closes odoo/odoo#40458

X-original-commit: be30a3ba431cf24a5fcfdfedd0f9d9f73163c717
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-18 19:28:21 +00:00
Andrea Grazioso (agr-odoo) 760ae910d4 [FIX] web_editor: restore debug assets in iframe
Open Mass Mailing in debug mode, create a new mass mailing,
choose a template for the body, check with the inspector the iframe.

The head of the iframe does not have the debug assets. This is because
the global variable relative to the debug mode gets temporary
overwritten before solving the promise.

For Gorash this has been done for:

* Performance as all the editor assets must be inserted into the iframe
assets
* As an indication to bugfixers that the fix must not be done in this
bundle as it is the exact same content as outside of the iframe and the
exact same content as previous Odoo versions.

Removing the override given that:

* If someone enable debug=assets he/she is aware of the performance hit
* A ticket has been opened because the iframe is hard to debug
without debug assets.

opw-2117649

closes odoo/odoo#40417

X-original-commit: 17c6952af3242c22bae2596f64b0addd04b9f9e0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-18 11:49:11 +00:00
jvm-odoo 6188378e57 [FIX] web_editor: fix wrong datetime parsing
Reproduce the issue

    - Install Events
    - Set the english default format date to %d/%m/%Y
    - Create an event & edit the date

    The date is set correctly in the backend

    - Edit the date of an event on the website directly

    The date format is still the old one

Cause

    The `from_html` method of DateTime was using `parser.parse` and
    ignore the user's date format.

This commit changes `parser.parse` into `datetime.strptime` taking
into consideration the user's date format.

closes odoo/odoo#40415

X-original-commit: d00c0e317f8affbe8bea231972c2b6da70b9f240
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-18 11:35:19 +00:00
qsm-odoo 00022bd7fc [REF] web_editor: get rid of we-collapse elements
Now, we should either use:
- A we-select (in the end, same as collapse except it does not push the
  elements in the UI)
- A simple div to always display the elements

Part of https://github.com/odoo/odoo/pull/38959
task-2066614

closes odoo/odoo#38959

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-18 09:56:40 +00:00
qsm-odoo 5db73c12d3 [IMP] web_editor: increase option sections readability
Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:40 +00:00
Samuel Degueldre dfd98f49e7 [IMP] web_editor: rework background-sizing option
Previously, background size and position for snippets was configured in
a modal, the user could choose a "focus point", which is rather
unintuitive. They could also choose to use the "contain" background
mode, with or without repeat, or a third option, where they could
customize everything, from the background size in both directions to
whether to repeat the background in only one or in both directions.

This commit streamlines the background-sizing options, only the "cover"
and "repeat pattern" options have been kept, as they cover almost every
use case. Their configuration has been moved into the options menu for
consistency with the rest of the editor, and the background's position
is now chosen by clicking on the corresponding menu option, and dragging
the background to the desired place.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088304
2019-11-18 09:56:40 +00:00
qsm-odoo 01debf53f6 [IMP] web_editor: allow to temporary block preview overlay toggling
This will allow to do the following:

1) Show a preview overlay over an element
2) Block preview overlays -> the overlay at step 1 stays no matter what
3) Encourage the user to do something that edits what the preview
   overlay is currently showing.
4) The edition is finished, go back to normal by unblocking preview
   overlays.

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:40 +00:00
qsm-odooandSamuel Degueldre 688e21b6e0 [IMP] website, *: add slide management buttons for carousel snippets
* web_editor

This commit adds a slide counter in carousel snippets option menu, as
well as left and right buttons, this way the user can manage their
slides entirely from the options, instead of having to go to the block
itself to navigate to where they want before going back to the option
menu to add or remove a slide.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088291

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2019-11-18 09:56:40 +00:00
qsm-odoo c879ac723b [FIX] website, *: no theme color suggestions during theme colors edition
* web_editor

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:40 +00:00
qsm-odooandfja-odoo ea994b0cbb [IMP] web_editor, *: review 'colorPalette' editor UI
*: website, mass_mailing

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383

Co-authored-by: fja-odoo <fja@odoo.com>
2019-11-18 09:56:40 +00:00
fja-odoo 22c5fc5dd2 [IMP] web_editor, website: generalize colorpicker
Currently we have:
- a colorpicker for background color of snippets
- a colorpicker for foreground and background text (topbar)
- a colorpicker for menu/footer/navbar/etc
These 3 are separate colorpickers with different options.

After this Commit
All 3 will use the same color palette wich allow you to select
theme color, common colors, custom color and transparent filter.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383
2019-11-18 09:56:40 +00:00
Samuel Degueldre f615cfda89 [IMP] website, *: rework snippet anchor system
* web_editor

Previously, the user could choose their anchor names using a modal
window, anchor names also have weird rules, this was not a great user
experience.

This commit makes the anchor button generate anchors automatically based
on the first title in a section, or the snippet name if there are none.
If the anchor name is already taken, it is suffixed by a number. After
it has been generated, it is also copied to the clipboard and the user
is shown a toast to tell them the anchor has been generated and copied.
The anchor is displayed in the toast along with an edit button that will
open the same edition modal as previously, but it is now less
restrictive.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088270
2019-11-18 09:56:08 +00:00
qsm-odoo bf5b4b6933 [IMP] website, *: introduce inputs in the left panel UI
* web_editor, website_sale

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo c47527b794 [IMP] web_editor: allow options to add UI in the overlay top bar
-> move the move buttons next to the drag button

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo c213afab86 [IMP] web_editor, *: review 'background' options' UI
* website

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo 72a2f417ae [IMP] web_editor, *: introduce select & checkboxes for the left panel UI
* website, website_blog, website_form, website_sale

+ introduce default UI for snippet options
+ refactor style of icon buttons

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo ed8133c72f [IMP] web_editor, *: allow snippet options next to clone/delete buttons
* website

Now snippet options can be defined as a button which can be placed next
to the clone and delete buttons, through a new "isTopOption" method.

This commit also review the buttons and title design and take advantage
of the feature to review the way snippets options are added in their
container (that code indeed contained useless part since 13.0).

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo c611d92191 [REF] website, *: remove useless palette title option
Not relevant anymore in the new editor UI.

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo d9bbdf15ad [REF] website, *: remove all snippet options UI icons
* web_editor, website_blog, mass_mailing

In preparation of the new left panel UI, remove all snippet options UI
icons as we do not want them anymore to simplify the UI.

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:07 +00:00
qsm-odoo 0cbc188a71 [FIX] web_editor: prevent focus change on recording undos
Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:07 +00:00
qsm-odoo d57e0cb1e7 [FIX] web_editor: remove destroyed editors from memory
Commit https://github.com/odoo/odoo/commit/f6bbc40fbe16ea5ab01ad03b8e1519c4e559bf6d
introduced a method to destroy all current editors to refresh them when
necessary... but forgot to empty the array that contains them.

In a 12.0 without custo, this is only slowing down the editor but in
master (or with custo) this makes the editor crash.

closes odoo/odoo#40372

X-original-commit: 2b5661937d9772b98c73f9f64aa419fec7676052
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-15 17:10:56 +00:00
Samuel Degueldre 17d6ea235a [FIX] web_editor, *: fix crash when saving cropped image
*: point_of_sale

In c212cfe899 the field 'datas_fname' was
removed as it was mostly almost always a duplicate of the name or url
field. Two uses of this field were not removed in the rest of the code,
one in web_editor which caused a crash when trying to save a cropped
image. There was also one in pos_order, which I changed at the same
time, even though it isn't known to cause a bug yet, the create call is
bound to fail if it is ever triggered.

closes odoo/odoo#40329

X-original-commit: 7088d11b7f2de7ffaa5b7045b562784f7176f75d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-15 11:57:13 +00:00
Nicolas Lempereur 614666257f [FIX] web_editor: reintroduce source mode in debug
In 12.3 there was a number of changes in source mode. This was reverted
before 13.0 and somehow it seems the source mode was lost between the
12.3 editor changes and its revert.

With this changeset, we introduce back source mode as it was in 12.

opw-2091649
opw-2116960
closes #40026

closes odoo/odoo#40120

X-original-commit: e29c08969f6e7ad981e9b7b79027d84dc89fbca2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-12 12:32:02 +00:00
Nicolas Lempereur a3f5afdd53 [FIX] web_editor: link dialog over image keep image
In f29699231 (12.3) part of the code of the editor `Link Dialog` was
moved to a web_editor/static/src/js/wysiwyg/plugin/link.js file/class.

In 13.0 the 12.3 editor changes were mostly reverted in 35b61822a but
part of the change of `Link Dialog` that was moved to another file/class
was not moved back, thus: it does not work as expected => eg. if we add
a link over an image, the image is removed.

In this commit we get back the missing part as it was in 12.0 version.

opw-2086444
closes #39858

closes odoo/odoo#39881

X-original-commit: 9996d04fd2ec8329cd5561a4bc94ccc35d529d93
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-06 14:33:49 +00:00
qsm-odoo 21d230abca [FIX] web_editor: prevent deleting carousel-item with the delete button
Indeed, the carousel-item elements are linked to other DOM (like
indicators) and removing one would imply enabling another one... all of
this is handled by the carousel "remove slide" option.

Note: the UI to add and remove slides will be refactored in a future
update of this future saas anyway.

Part of https://github.com/odoo/odoo/pull/38997
task-2090180

closes odoo/odoo#38997

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-06 12:26:27 +00:00
Samuel Degueldre 958c850f9f [REF] website, web_editor: refactor (quotes) carousel snippets
Previously, the carousel and quotes carousel snippets were the only ones
that were not enclosed in section blocks. This had a number of
undesirable side effects, such as editing the anchor on the carousel
breaking the carousel functionality, and the inability to separately
choose a background for the carousel itself and individual slides.

I also used this opportunity to move controls relative to the entire
carousel onto the carousel itself rather than the individual slides. The
sizing_y (vertical padding) will however keep targeting individual
slides, as the carousel uses the height of its tallest slide, and also
because padding on the carousel will not get covered by slide
backgrounds and saty blank, which is unwanted.

Lastly, most of the snippet options for the carousel were rewritten, as
they were quite broken. There was some compatibility code for saas-3
left, some useless events were bound to the controls, even though they
were already handled through event-delegation at the document level.
Finally, most of the edition features were broken on duplicated
carousels since the onClone method wasn't reassigning most of the things
it needed to.

Part of https://github.com/odoo/odoo/pull/38997
task-2090180
2019-11-06 12:26:27 +00:00
qsm-odoo aa62e95718 [REF] web_editor: allow to enable DOM editors only if not already active
Related to https://github.com/odoo/odoo/pull/38997
Related to task-2090180
2019-11-06 12:25:38 +00:00
qsm-odoo 5c007305c9 [REF] web_editor: review overlay/option toggling
Previously, when trying to enable a snippet overlay & options, the
'toggleFocus' method was called. Now the logic is separated for overlay
and options toggling so that we stop calling onFocus/onBlur method of
parent options when only a child snippet is being enabled.

For example, for a section with two columns inside, we had this behavior
before this commit:

1) Click on first column
2) -> the section's onFocus is called
3) -> the first column's onFocus is called
4) Click on second column
5) -> the section's onBlur is called
6) -> the first column's onBlur is called
7) -> the section's onFocus iscalled
8) -> the second column's onFocus is called
9) Click on another snippet
10) -> the section's onBlur is called
11) -> the second column's onBlur is called

Now, steps 5 and 7 are gone.

Related to https://github.com/odoo/odoo/pull/38997
Related to task-2090180
2019-11-06 12:25:38 +00:00