[MIG] 10.0 web_fullscreen

This commit is contained in:
KKamaa
2019-04-17 17:41:13 +03:00
parent 7496beb413
commit 7976daf4f6
10 changed files with 83 additions and 50 deletions

View File

@@ -0,0 +1,3 @@
.o_control_panel .o_cp_fullscreen {
padding-left: 5px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 KiB

View File

@@ -1,27 +1,17 @@
openerp.web_fullscreen = function(instance, local) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
local.FullscreenButton = instance.Widget.extend({
template: 'FullscreenButton',
events: {
"click a": "toggle"
},
toggle: function() {
$("#oe_main_menu_navbar").toggle();
$(".oe_leftbar").toggle();
},
start: function() {
this.$el.find('a').tooltip();
}
});
instance.web.ViewManager.include({
start: function() {
odoo.define('web.fullscreen', function (require) {
"use strict";
var ControlPanel = require('web.ControlPanel');
ControlPanel.include({
start: function () {
this._super.apply(this, arguments);
var btn = new local.FullscreenButton(this);
return btn.appendTo(this.$el.find('.oe_view_manager_switch'));
}
this.$el.on('click', '.o_cp_fullscreen', function () {
$("#oe_main_menu_navbar").toggle();
$(".o_sub_menu").toggle();
});
},
});
}
/* eslint require-jsdoc: 0*/
});

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-extend="ControlPanel">
<t t-jquery=".o_cp_switch_buttons" t-operation="after">
<div class="btn-group btn-group-sm o_cp_fullscreen">
<button class="btn btn-icon fa fa-lg fa-tablet"
data-toggle="tooltip" data-placement="top"
aria-expanded="false" href="#">
<i title="Fullscreen Mode"
aria-hidden="true"/>
</button>
</div>
</t>
</t>
</templates>