summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/utils.js
diff options
context:
space:
mode:
authorPratima Gupta <pgu@odoo.com>2019-07-16 12:03:11 +0000
committerSébastien Theys <seb@odoo.com>2019-07-17 15:53:31 +0000
commitb492bde6a121be1c15ed90ce0827fcfd72a12f5c (patch)
tree6c030035b8e0f5a743806c809d1ef7ef244e25be /addons/web/static/src/js/core/utils.js
parent4d942852c82414bd986112230a3e8e2d183b5c59 (diff)
[IMP] account, portal, web, website: move chatter below invoice
No more modal because it's not visible and less handy. Use same behavior as sales order portal. Adapt the invoice style to properly adapt and align with the chatter block. Part of task-37264 closes odoo/odoo#34360 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Pratima Gupta <pgu@odoo.com> Co-authored-by: Sébastien Theys <seb@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/core/utils.js')
-rw-r--r--addons/web/static/src/js/core/utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js
index 44e17324b85..e3911752aaa 100644
--- a/addons/web/static/src/js/core/utils.js
+++ b/addons/web/static/src/js/core/utils.js
@@ -440,6 +440,18 @@ var utils = {
return (/^\d+(\.\d*)? [^0-9]+$/).test(v);
},
/**
+ * Returns whether the given anchor is valid.
+ *
+ * This test is useful to prevent a crash that would happen if using an invalid
+ * anchor as a selector.
+ *
+ * @param {string} anchor
+ * @returns {boolean}
+ */
+ isValidAnchor: function (anchor) {
+ return /^#[\w-]+$/.test(anchor);
+ },
+ /**
* @param {any} node
* @param {any} human_readable
* @param {any} indent