[IMP] discuss: action buttons always visible on touch screens

We add the o_touch_device css class to the body (it was done in enterprise only), and various other small changes to make sure that the action buttons (in discuss, next to the message title) are always visible (not only on hover) when we are on a touch device. (pr (#15459, closes task 31208)
This commit is contained in:
Dhaval Panchal
2017-05-17 14:39:09 +02:00
committed by ged-odoo
parent 6ea3b8de38
commit db41366b67
3 changed files with 26 additions and 13 deletions
+16 -9
View File
@@ -69,14 +69,14 @@
opacity: 0;
}
}
i.o_thread_message_star, i.o_thread_message_needaction, i.o_thread_message_reply, i.o_thread_message_email {
.o_thread_icons {
cursor: pointer;
opacity: 0;
&.fa-star {
opacity: @mail-thread-icon-opacity;
color: gold;
> .o_thread_icon {
opacity: 0;
&.fa-star {
opacity: @mail-thread-icon-opacity;
color: gold;
}
}
}
@@ -84,8 +84,7 @@
.o_thread_message_side_date {
opacity: @mail-thread-side-date-opacity;
}
i.o_thread_message_star, i.o_thread_message_needaction, i.o_thread_message_reply, i.o_thread_message_email {
.o_thread_icons > * {
opacity: @mail-thread-icon-opacity;
&:hover {
opacity: 1;
@@ -207,3 +206,11 @@
display: block;
}
}
.o_web_client.o_touch_device {
.o_thread_icons {
> .o_thread_icon {
opacity: @mail-thread-icon-opacity;
}
}
}
+4 -4
View File
@@ -109,15 +109,15 @@
</t>
</span>
</span>
<span>
<span t-attf-class="o_thread_icons">
<i t-if="options.display_stars &amp;&amp; !message.is_system_notification"
t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
t-att-class="'fa fa-lg o_thread_icon o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
t-att-data-message-id="message.id" title="Mark as Todo"/>
<i t-if="message.record_name &amp;&amp; message.model != 'mail.channel' &amp;&amp; options.display_reply_icon"
class="fa fa-reply o_thread_message_reply"
class="fa fa-reply o_thread_icon o_thread_message_reply"
t-att-data-message-id="message.id" title="Reply"/>
<i t-if="message.is_needaction &amp;&amp; options.display_needactions"
class="fa fa-check o_thread_message_needaction"
class="fa fa-check o_thread_icon o_thread_message_needaction"
t-att-data-message-id="message.id" title="Mark as Read"/>
</span>
</p>
@@ -14,6 +14,7 @@ odoo.define('web.AbstractWebClient', function (require) {
var ActionManager = require('web.ActionManager');
var concurrency = require('web.concurrency');
var core = require('web.core');
var config = require('web.config');
var crash_manager = require('web.crash_manager');
var data_manager = require('web.data_manager');
var Dialog = require('web.Dialog');
@@ -91,6 +92,11 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, {
start: function () {
var self = this;
// we add the o_touch_device css class to allow CSS to target touch
// devices. This is only for styling purpose, if you need javascript
// specific behaviour for touch device, just use the config object
// exported by web.config
this.$el.toggleClass('o_touch_device', config.device.touch);
this.on("change:title_part", this, this._title_changed);
this._title_changed();