From 1144235d06a2ad42060c05d4ece145ce46a660e1 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 11 Dec 2018 14:31:42 +0000 Subject: [PATCH] [FIX] website_forum, *: remove underline on icon buttons hovering * portal In our default theme, when hovering links (or .btn-link elements), the text is underlined. This effect is however not desired for links which contain only an icon, especially in the forum. This commit removes that underline effect for all icon buttons in the frontend (at least by default, this is a theme choice). Icon buttons are defined as link or .btn-link elements which directly use the "fa" class on them. This commit also solves the flag button of the forum which did not have any effect because of bad bootstrap use. closes odoo/odoo#29434 --- addons/portal/static/src/scss/portal.scss | 7 +++++++ addons/portal/static/src/scss/primary_variables.scss | 2 ++ addons/website_forum/static/src/js/website_forum.js | 2 +- addons/website_forum/views/website_forum.xml | 5 ++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/portal/static/src/scss/portal.scss b/addons/portal/static/src/scss/portal.scss index c5a49e59368..af3882c74ae 100644 --- a/addons/portal/static/src/scss/portal.scss +++ b/addons/portal/static/src/scss/portal.scss @@ -87,6 +87,13 @@ ul.flex-column > li > a { padding: 2px 15px; } +// Link without text but an icon +a, .btn-link { + &.fa:hover { + text-decoration: $o-theme-btn-icon-hover-decoration; + } +} + // Odoo options classes .jumbotron { margin-bottom: 0; diff --git a/addons/portal/static/src/scss/primary_variables.scss b/addons/portal/static/src/scss/primary_variables.scss index 3bdd824ccb7..68a1664e93c 100644 --- a/addons/portal/static/src/scss/primary_variables.scss +++ b/addons/portal/static/src/scss/primary_variables.scss @@ -1 +1,3 @@ $o-portal-default-body-bg: #FCFCFC; + +$o-theme-btn-icon-hover-decoration: none; diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 5ab377fc561..e79dd72ccea 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -261,7 +261,7 @@ sAnimations.registry.websiteForum = sAnimations.Class.extend({ ev.preventDefault(); var $link = $(ev.currentTarget); this._rpc({ - route: $link.data('href') || $link.attr('href') || $link.attr('action'), + route: $link.data('href') || ($link.attr('href') !== '#' && $link.attr('href')) || $link.attr('action'), }).then(function (data) { if (data.error) { var $warning; diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 5d937ff69f3..3fb9bf4a9ed 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -756,11 +756,11 @@ - + > @@ -982,7 +982,6 @@
-