summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-02-12 13:20:23 +0000
committerqsm-odoo <qsm@odoo.com>2019-02-26 17:09:23 +0000
commitd946b7a85d2c1bbc20ace8e2b269be56a63876fd (patch)
tree00bf82d77d98719fe717ddde11463d21fed3507c /addons/website/static/src/js
parent335a505d1f9b6a978c0fe0f6ea760a45b0d0a67f (diff)
[REF] website, *: use public widgets instead of website animations
* website_blog, website_crm_partner_assign, website_event, website_event_track, website_form, website_forum, website_links, website_mail, website_mail_channel, website_mass_mailing, website_sale, website_sale_comparison, website_sale_delivery, website_sale_stock, website_sale_wishlist, website_slides, website_twitter While using the 'Animation' class of website instead of the frontend 'Widget' class leads to the same behaviors, this refactoring is done for two reasons: - Stop using the confusing 'Animation' name for non-animated behaviors - Instantiation of 'Widget' is slightly faster than 'Animation' Part of https://github.com/odoo/odoo/pull/29442 task-1932066
Diffstat (limited to 'addons/website/static/src/js')
-rw-r--r--addons/website/static/src/js/content/menu.js8
-rw-r--r--addons/website/static/src/js/user_custom_javascript.js4
2 files changed, 6 insertions, 6 deletions
diff --git a/addons/website/static/src/js/content/menu.js b/addons/website/static/src/js/content/menu.js
index b8ea9f61564..e24ef22a530 100644
--- a/addons/website/static/src/js/content/menu.js
+++ b/addons/website/static/src/js/content/menu.js
@@ -2,10 +2,10 @@ odoo.define('website.content.menu', function (require) {
'use strict';
var dom = require('web.dom');
-var sAnimation = require('website.content.snippets.animation');
+var publicWidget = require('web.public.widget');
var wUtils = require('website.utils');
-sAnimation.registry.affixMenu = sAnimation.Class.extend({
+publicWidget.registry.affixMenu = publicWidget.Widget.extend({
selector: 'header.o_affix_enabled',
/**
@@ -101,7 +101,7 @@ sAnimation.registry.affixMenu = sAnimation.Class.extend({
* Note: this works well with the affixMenu... by chance (autohideMenu is called
* after alphabetically).
*/
-sAnimation.registry.autohideMenu = sAnimation.Class.extend({
+publicWidget.registry.autohideMenu = publicWidget.Widget.extend({
selector: 'header #top_menu',
/**
@@ -151,7 +151,7 @@ sAnimation.registry.autohideMenu = sAnimation.Class.extend({
*
* @todo check bootstrap v4: maybe handled automatically now ?
*/
-sAnimation.registry.menuDirection = sAnimation.Class.extend({
+publicWidget.registry.menuDirection = publicWidget.Widget.extend({
selector: 'header .navbar .nav',
events: {
'show.bs.dropdown': '_onDropdownShow',
diff --git a/addons/website/static/src/js/user_custom_javascript.js b/addons/website/static/src/js/user_custom_javascript.js
index 928fb0a7b9f..a68d298ba01 100644
--- a/addons/website/static/src/js/user_custom_javascript.js
+++ b/addons/website/static/src/js/user_custom_javascript.js
@@ -10,9 +10,9 @@ odoo.define('website.user_custom_code', function (require) {
'use strict';
var Dialog = require('web.Dialog');
-var sAnimations = require('website.content.snippets.animation');
+var publicWidget = require('web.public.widget');
-sAnimations.registry.HelloWorldPopup = sAnimations.Class.extend({
+publicWidget.registry.HelloWorldPopup = publicWidget.Widget.extend({
selector: '#wrapwrap',
start: function () {