summaryrefslogtreecommitdiff
path: root/addons/website/views
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2019-10-18 09:06:09 +0000
committerqsm-odoo <qsm@odoo.com>2019-11-18 09:56:08 +0000
commitf615cfda89dae2e9a550d25868b11bc06b97cfcb (patch)
tree03a13d7a551ffd5bab684a72ad4692f45877dd35 /addons/website/views
parentbf5b4b69330747af7b09d48e59218b78a29a4b14 (diff)
[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
Diffstat (limited to 'addons/website/views')
-rw-r--r--addons/website/views/snippets.xml5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml
index e496d088f50..955babf1637 100644
--- a/addons/website/views/snippets.xml
+++ b/addons/website/views/snippets.xml
@@ -1352,13 +1352,12 @@
</div>
<!-- Anchor Name -->
- <div data-js="anchorName"
+ <div data-js="anchor"
data-selector=":not(p).oe_structure > *, :not(p)[data-oe-type=html] > *"
data-exclude=".modal *">
<we-button class="fa fa-fw fa-link"
title="Create a link to target this section"
- data-no-preview="true"
- data-open-anchor-dialog=""/>
+ data-no-preview="true"/>
</div>
<!-- Mega Menu settings -->