[REF] website: remove anchor option on columns

The anchor option was available on column so that you can target a
column which wraps on a new line in mobile... but we decided to remove
the feature as it complexify the UI.

Also fix a small bug: it was not possible to hit "save" when not
changing the anchor name of an element (an error message was displayed
to say it is already used in the page... while it is in fact used by
itself).

Part of https://github.com/odoo/odoo/pull/36515
This commit is contained in:
qsm-odoo
2019-09-10 11:49:34 +00:00
parent fb6b7013c9
commit 53e428aa45
2 changed files with 8 additions and 1 deletions
@@ -1492,6 +1492,13 @@ options.registry.anchorName = options.Class.extend({
click: function () {
var $input = this.$('.o_input_anchor_name');
var anchorName = $input.val().trim().replace(/\s/g, '_');
if (self.$target[0].id === anchorName) {
// If the chosen anchor name is already the one used by the
// element, close the dialog and do nothing else
this.close();
return;
}
var isValid = /^[\w-]+$/.test(anchorName);
var alreadyExists = isValid && $('#' + anchorName).length > 0;
var anchorOK = isValid && !alreadyExists;
+1 -1
View File
@@ -1444,7 +1444,7 @@
<!-- Anchor Name -->
<div data-js="anchorName"
data-selector=":not(p).oe_structure > *, :not(p)[data-oe-type=html] > *, .row > div"
data-selector=":not(p).oe_structure > *, :not(p)[data-oe-type=html] > *"
data-exclude=".modal *">
<we-button data-no-preview="true" data-open-anchor-dialog="">
<i class="fa fa-fw fa-anchor"/> Link Anchor