diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-02-12 13:20:23 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-02-26 17:09:23 +0000 |
| commit | d946b7a85d2c1bbc20ace8e2b269be56a63876fd (patch) | |
| tree | 00bf82d77d98719fe717ddde11463d21fed3507c /addons/website_forum/static/src/js | |
| parent | 335a505d1f9b6a978c0fe0f6ea760a45b0d0a67f (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_forum/static/src/js')
| -rw-r--r-- | addons/website_forum/static/src/js/website_forum.js | 6 | ||||
| -rw-r--r-- | addons/website_forum/static/src/js/website_forum.share.js | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index d1ce5b18f5c..cdc49881a5b 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -3,13 +3,13 @@ odoo.define('website_forum.website_forum', function (require) { var core = require('web.core'); var Wysiwyg = require('web_editor.wysiwyg.root'); -var sAnimations = require('website.content.snippets.animation'); +var publicWidget = require('web.public.widget'); var session = require('web.session'); var qweb = core.qweb; var _t = core._t; -sAnimations.registry.websiteForum = sAnimations.Class.extend({ +publicWidget.registry.websiteForum = publicWidget.Widget.extend({ selector: '.website_forum', xmlDependencies: ['/website_forum/static/src/xml/website_forum_share_templates.xml'], events: { @@ -503,7 +503,7 @@ sAnimations.registry.websiteForum = sAnimations.Class.extend({ }, }); -sAnimations.registry.websiteForumSpam = sAnimations.Class.extend({ +publicWidget.registry.websiteForumSpam = publicWidget.Widget.extend({ selector: '.o_wforum_moderation_queue', xmlDependencies: ['/website_forum/static/src/xml/website_forum_share_templates.xml'], events: { diff --git a/addons/website_forum/static/src/js/website_forum.share.js b/addons/website_forum/static/src/js/website_forum.share.js index 0fea6e4ef9c..f849fe7ada4 100644 --- a/addons/website_forum/static/src/js/website_forum.share.js +++ b/addons/website_forum/static/src/js/website_forum.share.js @@ -2,14 +2,14 @@ odoo.define('website_forum.share', function (require) { 'use strict'; var core = require('web.core'); -var sAnimations = require('website.content.snippets.animation'); +var publicWidget = require('web.public.widget'); var qweb = core.qweb; // FIXME There is no reason to inherit from socialShare here -var ForumShare = sAnimations.registry.socialShare.extend({ +var ForumShare = publicWidget.registry.socialShare.extend({ selector: '', - xmlDependencies: sAnimations.registry.socialShare.prototype.xmlDependencies + xmlDependencies: publicWidget.registry.socialShare.prototype.xmlDependencies .concat(['/website_forum/static/src/xml/website_forum_share_templates.xml']), events: {}, @@ -69,7 +69,7 @@ var ForumShare = sAnimations.registry.socialShare.extend({ }, }); -sAnimations.registry.websiteForumShare = sAnimations.Class.extend({ +publicWidget.registry.websiteForumShare = publicWidget.Widget.extend({ selector: '.website_forum', events: { 'click :not(.karma_required).oe_social_share_call': '_onShareCallClick', |
