Skip to content
Snippets Groups Projects
  1. May 23, 2023
    • Romain Derie's avatar
      [FIX] website: correctly target footer on popup options · ca3d6e09
      Romain Derie authored
      
      The code was assuming there would be only one `<footer/>` element in the
      dom but it's not always true.
      Our `Blockquote` snippet also contains a `<footer/>` element.
      
      While this has no impact on Odoo 14 and Odoo 15, it will crash in Odoo
      16 when trying to select "On all pages" on a popup option when there is
      a blockquote snippet on a page.
      The reason it breaks in 16 is because it uses javascript instead of
      jquery, finding only one element (the footer of the blockquote) and not
      all. The jQuery usage was then filtering out to only keep the correct
      footer due to some extra selector looked for in the elements
      (`.oe_structure:o_editable`).
      
      Still, the fix is made in Odoo 14 because it's likely that we will have
      another fix later in the snippet options, and it's also likely that
      someone will replace the jQuery usage by javascript while doing so,
      which would reveal the bug.
      
      opw-3283140
      
      closes odoo/odoo#121848
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      ca3d6e09
  2. Dec 19, 2022
    • Benjamin Vray's avatar
      [FIX] web_editor, website: fix style tab selected after closing a popup · 987f189e
      Benjamin Vray authored
      
      Steps to reproduce the bug:
      
          - In edit mode, drag and drop a popup in a page.
          - Click on the "Win $20" text in the popup to activate the overlay
          of the column.
          - Close the popup by clicking on the "s_popup_close" button.
          - Bug => the "style" tab is still activated (instead of the "blocks"
          tab).
      
      This is actually a more general bug: when selecting text anywhere in the
      page, there is no check to know if the range is editable or not.
      (e.g. Selecting a link in the navbar of the "table of content" snippet
      makes the toolbar appear and it is possible to change the color/size of
      the selected text while these links are in a non-editable element.)
      
      This commit adds the missing check to know if a selected range is
      editable or not to show/hide the text toolbar.
      
      This commit also removes the duplicate
      "snippet_option_visibility_update" trigger_up when closing a popup with
      the "close" button. It is not necessary because it is called anyway in
      the "hide" event triggered by "onTargetHide".
      
      task-3072669
      
      closes odoo/odoo#105957
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      987f189e
  3. Jul 05, 2022
  4. Jan 28, 2022
    • Federico (fega)'s avatar
      [FIX] website, *: always allow scroll for popup taller than window · 8f1dd6d6
      Federico (fega) authored
      
      *: web_editor
      
      Steps to reproduce:
      - Activate the cookie dialog from the website settings
      - Remove the backdrop from the cookie dialog
      - Add some blocks to the cookie dialog in the website editor
      until the dialog height is bigger than the page height.
      
      Result:
      The cookie dialog is not scrollable, so it's impossible to reach
      the "I agree" button and close the dialog, leaving the user stuck
      at the first page.
      
      I check if the popup content is higher than the window. If it is, I
      give priority to the popup scroll over the page one. I had to
      overwrite the _showElement method to call _setScrollbar after
      the content rendering, in this way I can get its correct height.
      I also try to update the scrollbar each time a block in the cookie bar
      has been changed and each time the window resize. This is optimize, so
      if the overflow isn't changed from the last time I tried to update the
      scrollbar no action will be taken. In this way you can always see the
      whole popup without refreshing the page.
      
      Also I have to set 'pointer-events' to none only if the popup is
      smaller than the page itself (to interact with and scroll the
      page behind), otherwise the popup won't be scrollable. I did
      this by adding a class "s_popup_overflow_page" if the popup is
      higher than the page and I adapted the pointer-events
      property accordingly.
      
      opw-2660786
      
      closes odoo/odoo#80092
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      8f1dd6d6
  5. Nov 15, 2021
  6. Jun 12, 2020
    • Cocographique's avatar
      [IMP] website: improve "Popup" snippet · e5a5f988
      Cocographique authored
      Review the layout to always use standard bootstrap classes so that
      future task targeting modal can target s_popup snippets the same way
      (for example: our task allowing to open a popup on click on a button).
      
      This also allows to simplify the css and simplify the options. A new
      option also now allows to have a backdrop, or not, so that user clicks
      are blocked while the popup is opened, or not.
      
      + Adapt cookie bar accordingly.
      
      Part of https://github.com/odoo/odoo/pull/52698
      
      
      task-2210730
      
      Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
      e5a5f988
  7. Mar 24, 2020
  8. Jan 29, 2020
    • Romain Derie's avatar
      [IMP] website: introduce cookies bar on website · 3028e9a8
      Romain Derie authored
      With this commit, it is now possible to activate a cookies bar on a
      website through the res.settings.
      
      The cookies bar can be edited in the frontend by entering edit mode.
      
      The cookies bar will appear until the user clicks on 'I agree'.
      
      Part of https://github.com/odoo/odoo/pull/41294
      
      
      task-2087003
      
      closes odoo/odoo#41294
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      3028e9a8
    • Romain Derie's avatar
      [IMP] website: add consent duration on s_popup snippet · 3bce5277
      Romain Derie authored
      This commit introduce a new snippet option for s_popup to control the
      consent duration in days. This value will be used to know if the popup
      should be shown or not.
      If the user close the popup, it won't be shown until the consent
      duration is over.
      
      This will also avoid popup to be shown on exit (display mode) more than
      once. Indeed, every mouseout of the screen (changing tab, changing app,
      alt tab etc) would show the popup, as well as page navigation.
      
      Part of https://github.com/odoo/odoo/pull/41294
      task-2087003
      3bce5277
    • Romain Derie's avatar
      [FIX] web_editor, *: correctly find `o_snippet_invisible` · 506d2937
      Romain Derie authored
      *: website
      
      This commit is a safety nest to ensure `o_snippet_invisible` will be
      found, even if somehow they appear as one of the editable area elements.
      
      It might be the case with some refactoring, as it was the case between
      404fa816 and 83d99941c, in which case, the step to reproduce were:
        - Add s_popup snippet into the page
        - In the options, select 'Show On All pages' -> It moves to footer
        - Now save and enter Edit mode again
        - The invisible element (popup in this case) is in the DOM, the widget
          is working fine but it is not retrieved as an invisible element,
          thus not possible to edit it
      
      + lint/dead code
      
      Part of https://github.com/odoo/odoo/pull/41294
      task-2087003
      506d2937
  9. Dec 23, 2019
Loading