summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-12-11 14:31:42 +0000
committerqsm-odoo <qsm@odoo.com>2018-12-11 14:31:42 +0000
commit1144235d06a2ad42060c05d4ece145ce46a660e1 (patch)
treed25d05dea0f741865b22493cb6c7bffabdb7f6b6
parent13aae100e2bc0589e2313fd4105b39c0eeea4db0 (diff)
[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
-rw-r--r--addons/portal/static/src/scss/portal.scss7
-rw-r--r--addons/portal/static/src/scss/primary_variables.scss2
-rw-r--r--addons/website_forum/static/src/js/website_forum.js2
-rw-r--r--addons/website_forum/views/website_forum.xml5
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 @@
<t t-set="icon" t-value="'fa-check'"/>
<t t-set="karma" t-value="not question.can_moderate and question.forum_id.karma_moderate or 0"/>
</t>
- <a t-if="question.active" t-attf-style="#{not question.can_flag and 'display:none;' or ''}"
+ <a t-if="question.active" href="#" t-attf-style="#{not question.can_flag and 'display:none;' or ''}"
t-attf-class="flag px-3 py-2 #{not question.can_flag and 'karma_required' or ''}"
t-attf-data-karma="#{not question.can_flag and question.forum_id.karma_flag or 0}"
t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(question)}/flag" title="Flag"
- ><i t-attf-class="text-primary fa #{not question.can_flag and 'karma_required fa-flag-o' or 'fa-flag'}"/>
+ ><i t-attf-class="fa #{not question.can_flag and 'karma_required fa-flag-o' or 'fa-flag'}"/>
</a>
</div>
</div>
@@ -982,7 +982,6 @@
<div class="mt-2"><span t-field="message.body" class="oe_no_empty text-dark"/></div>
</small>
</div>
-
</div>
<div class="css_editable_mode_hidden">
<form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey js_website_submit_form"