When a snippet is out of the viewport or hidden, the overlay should
not be visible. Two distinct cases we had:
- When the page is scrolled, the header is sometimes hidden thanks to
tranform: translate(0, -100%); for some kind of effect -> the header
is thus still visible but out of the viewport, any selected snippet
inside that header would still have this overlay enabled so we would
see the move and delete button on the top of the screen.
- When the page is scrolled, with the vertical header, some part of the
header are hidden for the affixed version. If any snippet in those
hidden elements was selected, the overlay is still visible floating.
task-2312878
closesodoo/odoo#60658
X-original-commit: 8a949019fd39c6c07ae5827462ee96e15f3190a1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benjamin Vray <bvr@odoo.com>
Co-authored-by: Thanh Dodeur <tso@odoo.com>
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the
same time there is no easy way to fix it
STEPS:
* create a record with html field, e.g. project.task
* add an embedded video (File/Image icon)
* save
BEFORE: video doesn't work
AFTER: there is no option to add embedded video anymore
WHY:
* iframe tags are removed before storing html in database, so after saving a
record, embedded video doesn't work anymore
* possible fixes to activate embedded videos in backend:
* new field attribute sanitize_iframe=False
* adding iframe on client side -- the problem is that the backend doesn't
have mechanism to use animation in html fields like it's done in
website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632
---
opw-2353103
closesodoo/odoo#60477
X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
When the overlay covers a snippet, if that snippet is at the top of
the page, the options at the top of the overlay are hidden. A system
was made to make them change position in that case but this was broken
by [1], leaving the toggling of a class for that case but without its
related scss.
This commit restores that scss and also improves the detection of that
problematic case.
[1]: https://github.com/odoo/odoo/commit/4f27e52cabb77b8b1a9637a11185ddf882adc9afclosesodoo/odoo#60467
X-original-commit: 97f11571f9e3deacc9b9e1dc0d2cc8fc6b93f15c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Issue
- Install "Website" app
- Go to "Contact us" page on website
- Edit Page, then click on submit button to
edit form style
- Alter 'Recipient Email' by selecting a value
from 'autocomplete' values
Other input text options are also altered.
Cause
Due to chrome autocompletition, others text input fields are
also altered (like it will do with a form address).
In this case, the error was obvious since it alter also the
'Labels Width' who break the layout.
Solution
Disable autocompletition on `<input type='text'/>` options
elements.
opw-2361169
closesodoo/odoo#60481
X-original-commit: 48d4c8185482545b049e2fecf315dd66ab9472f8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Keep the original position of the background as a percentage. In this
way, we avoid converting in pixel a direction that we have not changed.
Part of #55857
Related to task-2318526
X-original-commit: b8ac4f6b0c0aaa17ccae43ad8756c5b807e29823
Before this commit, the mouseup event was not detected outside the
body element when resizing paddings.
task-2312878
closesodoo/odoo#60380
X-original-commit: 2766eee14341a2475bc1c33a032ea05b50becc29
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit disable the pointer events on the overlay during the mouse
wheel event. To prevent page scrolling from stopping when hovering
over the overlay.
task-2312878
closesodoo/odoo#60367
X-original-commit: 978cd02406495e7566cefb556276e2ac2292e3f8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
E.g. the scrolltop button option has a checkbox followed by a select
on the same row and the checkbox was partly cut because of it.
Part of https://github.com/odoo/odoo/pull/60271
task-2312878
X-original-commit: 70570c69989b49b8ab89d71ea89d19195e3028ae
Before this commit, line height on items in a select was not applied
if the items were in a we-title tag (this is the case when using the
string attribute on we-button instead of text content).
Part of https://github.com/odoo/odoo/pull/60271
task-2312878
X-original-commit: d184004c846234ecd9d9924c0e37472c03633f5c
Primary and link buttons are "hacked" by mailing themes scss. We thus
have to fix their preview if possible (as they are previewed as standard
bootstrap while they actually have a different look depending on the
mailing theme).
Note: this commit is obviously a big hack which calls for lots of
improvements in master.
FIXME: this only partially work due to the new editor, it has to be
fixed as soon as the master becomes stable again...
Part of https://github.com/odoo/odoo/pull/60308
opw-2360756
X-original-commit: 7bd7bc2513b72f5ffc006758c4bf4eb42ae6ed67
This solves an issue with svg images from Isometric for example. The
media dialog assigns width to its displayed images thanks to the
flex-basis and flex-grow properties of their container, based on the
aspect ratio of each image. This was done correctly for SVG images too.
However, after assigning a nice space for a specific SVG image, the
image itself was not made to fill that assigned space... it only worked
if the natural width of the image was higher than the assigned space.
This was of course more obvious with SVG files with no intrinsic width
as they would simply not appear.
closesodoo/odoo#60305
X-original-commit: 585aed8b49b98d014db1e06c11e42b0d38a0b8c6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Issue: Add dynamic carousel in the page, then change the footer template,
then reply "Yes, I want to save & reload", then the page is broken because
the new class and data attributes are not saved.
closesodoo/odoo#60077
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Any non `<span/>` element which was transformed into an icon thanks to
the media dialog was transform into a `<span/>` then processed by
summernote. In some cases, this processing breaks the DOM... for no
reason as the DOM should not have been transformed into a `<span/>` in
the first place: `<i/>` elements inside a `<span/>` for example should
stay `<i/>` elements after edition.
closesodoo/odoo#60202
X-original-commit: 4bfcb80e3664ccc74b7ec5e7e10ace6e44ab98d3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Sometimes, when clicking too fast, some methods were called on a
not-fully-initialized colorpalette, which made it crash.
task-2312878
closesodoo/odoo#60179
X-original-commit: 180099b3ddb78511930f48dc012d1856c3b2a03b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, dimensionless SVGs (SVGs with no intrinsic width or height)
were rendered with a width of 0 in the media-dialog on firefox. This is
caused by the fact that firefox reports a naturalWidth and naturalHeight
of 0 for dimensionless images, which we were relying on to compute the
image's aspect ratio. See:
https://github.com/whatwg/html/issues/3510#issuecomment-369982529
for more details on the way browsers handle dimensionless images.
This commit fixes that by giving the image a width, letting the browser
render the image, and reading the height of the rendered image to
compute the aspect ratio in the cases where the naturalHeight of the
image is 0.
task-2345120
closesodoo/odoo#59958
X-original-commit: 616c78e00e6d2760e1cf3425fc7247792f2ceb61
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since the editor panel is placed on the right, the content was not
possible to scroll when in a iframe, like for mass mailing. This was
because of some strange code introduced with [1]. As the problem the
mentioned commit says fixing is still fixed without that code, I see
no reason to keep this... especially since it may introduce difference
between readonly and editmode content.
[1]: https://github.com/odoo/odoo/commit/f9bf408a827fa86323bc2d1891cb5173b4781e7bclosesodoo/odoo#59927
X-original-commit: 58ade8c0e17be14fb5bf9cef592c9b9225d21b6d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, background-images were not properly optimized when inserted,
whereas they should be just like regular images. This commit fixes that.
It also changes the default quality (used for automatic optimization) to
75 as the difference is not usually very noticeable but can bring a big
decrease in image size.
task-2357332
closesodoo/odoo#59779
X-original-commit: 5d8c0aa0f7678f51e0a0931b0410a0273c7c7d1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
with background-sizing option, user drags background image to adjust its
position using an overlay with the same content from snippet (cloned element).
Some CSS child selector rules will not be applied since the clone element has
a different container from the snippet content.
The CSS "background-attachment" property should be the same in
both parallax snippet & its copy, this will keep the preview more "wysiwyg"
instead of getting different result when bg position saved.
This can be improved by copying all style from snippet content and
override it with overlay related style (copying all css into overlay will
not work since it will change the style of its content too)
task-2327025
closesodoo/odoo#59775
X-original-commit: aaa3e63985789ea07464a5957eb18481e70a383f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, rainy 05 and wavy 06 had a bottom color with a hard edge.
This means that in order to not have a harsh color transition in the
section, the user would have to match the bottom color to the background
color of the section or vice versa. This commit makes it so that this
color is transparent by default instead. This means that the user can
now simply choose the background color and have the same result, without
having to configure two separate colors.
Part of: odoo/odoo#58333closesodoo/odoo#59420
X-original-commit: 8e6728f7fa486e264737ce068f637c8a76fdb7d9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit the clickable zone of a checkbox in the editor was
all the width of the panel.
After this commit, the clickable zone is only the label width + the
checkbox width. Also, the active and hover states of the label have been
removed to not confuse the user.
task-2312878
closesodoo/odoo#59406
X-original-commit: 61ffe97d03deae0aee72568311c453d1cd3470c8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
when media dialog launched for the first time (with no selected
media attachment), "FileWidget.selectedAttachments" contains a default
object {url:... , alt:...} (default attachment already on the target),
and the click on "Add" button will cause a backtrace since the code on
"_save" method tries to access "image_src" attribute on all selectedAttachments
elements including default one.
The simplest solution would be to check if the object already has
an "image_src" attribute.
task-2312878
closesodoo/odoo#59351
X-original-commit: ecffbe4060eea98d3444f308bcd28bfb9287e1c3
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit to select a parent snippet you had to click on
its title in the editor panel.
After this commit, we can still click on the title but also on the
whole line. At the same time, make it so the title has a pointer
cursor and so that long titles work too.
task-2327182
closesodoo/odoo#59262
X-original-commit: 5d3310cea75014ce3c43ee89235cd42b87e0cf99
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benjamin Vray <bvr@odoo.com>
With the recent addition of the parallax option on all snippets,
background-image urls were being converted from relative to absolute on
snippet-drop. This was caused by trying to read the background-image's
url and setting it back onto the target, but there is no way to reliably
read a background-image url in relative form, so it was returned in
absolute form and then written back to the element as is.
This commit fixes that by always converting the absolute URL to relative
when they are on the same origin as the database.
task-2312878
closesodoo/odoo#59113
X-original-commit: 7558dcce791f707e3f3470835133f91ec7ff074f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit lays the groundwork for the new editor by adding empty files to the assets in
order to change them later on. The new editor is not stable enough to be merged right
now, but delaying it to 15.0 would be problematic as the current editor has many bugs that
we are unable to fix because of how summernote interacts with browser-dependent code as well
as all the hacks that were done on top of it for Odoo since 8.0.
Before this commit, we were looking for text content inside SVG element
to set the selected value of a select in the editor panel.
After this commit, we avoid looking inside SVG tags.
task-2312878
closesodoo/odoo#58941
X-original-commit: 338f8d843832c339c52c00c7f4c41b5ab2d696ed
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
Before this commit, the elements (other than section) and with the
background layer options avaible (shape, color filter, etc.) did not
have the relative position added on their children. So all the
children were hidden behind the layer element which is in absolute
position.
Part of https://github.com/odoo/odoo/pull/58850
task-2312878
X-original-commit: 9c08e119b125b82e2c42dc944920dd8a96789e25
Before this commit the layout of the front-end edition of tags in blog
was broken. And the default value of the select element was not filled.
We fixed those design issues and also improve some small design
details. And for the select issue, we add a return value in the
computeWidgetState of the addTag method because even if the value will
still be empty we need to return something because we want the select
to be filled by the default value of setValue() wich is "/".
task-2312878
closesodoo/odoo#58860
X-original-commit: 9a04c8146c799ecd5efa6ba42582d4664a1a3a51
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Add a z-index on remove btn in media dialog because before that the
button was hidden behind images. Also review a little bit the style of
the button.
task-2312878
closesodoo/odoo#58839
X-original-commit: 4a8239c86e3fdf2830bd4f52d2424fe0f83d4639
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The design was made considering the units would not be bigger than 2 or
3 characters... but it is currently used with translated texts like
"products". In those cases, force the input to be full-width.
task-2312878
closesodoo/odoo#58787
X-original-commit: b1f9057af0d38176985ecfbe125ae992422b9744
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The text tools are being reworked with the new editor. Meanwhile, this
commit will get closer to the desired design with a pure CSS solution.
Part of https://github.com/odoo/odoo/pull/58638
X-original-commit: ad20f2b97ef925a27cef4976462d3d0aa39d0433
*: website
As the text editor is still the summernote one, this improvement was
made possible through a series of hack. It has to be reviewed once the
new editor is ready.
This makes the text tools only appear in the style tab by switching to
it as soon as the summernote tools are updated. To prevent flickering,
css and js hacks had to be made.
This also moves the undo/redo buttons in the top bar with another hack:
those simulates click on the hidden summernote ones.
Part of https://github.com/odoo/odoo/pull/58638
X-original-commit: 0f65015b1b0a849bf109df11fd18a9e3a62820e4
*: website
Inside a color combination (or outside, as considered the same as inside
color combination number 1), the link color can be configured. It is
set by themes to one of the 5 theme colors. Sometimes, no color of
those 5 colors contrast enough with the color combination's background
and we accepted that before, relying on the fact the user can change the
link color if he wants too. Now we automatically increase the contrast
of those link colors, except if the user overrides it.
This system might be extended to all foreground colors in the future but
the system has to be improved for that.
closesodoo/odoo#58739
X-original-commit: f8abb476fe0475799a3da66d49a92c7de2ace8a0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>