mirror of https://github.com/OCA/web.git
[MIG] 10.0 web_fullscreen
parent
7496beb413
commit
7976daf4f6
|
@ -6,7 +6,22 @@
|
||||||
Fullscreen
|
Fullscreen
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Adds a fullscreen mode button that toggles the primary and secondary menu.
|
Adds a fullscreen mode button that toggles the primary
|
||||||
|
and secondary menu.
|
||||||
|
|
||||||
|
**NB:** This module will be less useful if *web_responsive* module is installed
|
||||||
|
since it contains the functionality described above. The major reason why this
|
||||||
|
module was ported from `8 <https://github.com/onesteinbv/addons-onestein/tree/8.0/web_fullscreen>`_ to 10 is because, it targets the traditional GUI and
|
||||||
|
just adds a small fullscreen button on views, in order to see more clearly on
|
||||||
|
small screens.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
======
|
||||||
|
|
||||||
|
.. image:: /web_fullscreen/static/src/img/web_fullscreen.gif
|
||||||
|
:width: 1063
|
||||||
|
:alt: check the static/img folder for a demo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
|
@ -16,3 +31,18 @@ Contributors
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* Dennis Sluijk <d.sluijk@onestein.nl>
|
* Dennis Sluijk <d.sluijk@onestein.nl>
|
||||||
|
* Tom Blauwendraat <tblauwendraat@therp.nl>
|
||||||
|
|
||||||
|
|
||||||
|
Maintainer
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. image:: http://odoo-community.org/logo.png
|
||||||
|
:alt: Odoo Community Association
|
||||||
|
:target: http://odoo-community.org
|
||||||
|
|
||||||
|
This module is maintained by the OCA.
|
||||||
|
|
||||||
|
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
|
||||||
|
|
||||||
|
To contribute to this module, please visit http://odoo-community.org.
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2016 Onestein (<http://www.onestein.eu>)
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2016 Onestein (<http://www.onestein.eu>)
|
# Copyright 2016 Onestein (<http://www.onestein.eu>)
|
||||||
|
# Copyright 2019 Sunflower IT (<http://www.sunflowerweb.nl>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Fullscreen',
|
'name': 'Fullscreen',
|
||||||
'summary': 'Adds a fullscreen mode button',
|
'summary': 'Adds a fullscreen mode button',
|
||||||
'author': 'Onestein',
|
'author': 'Onestein, Sunflower IT, Odoo Community Association (OCA)',
|
||||||
'website': 'http://www.onestein.eu',
|
'license': 'AGPL-3',
|
||||||
|
'website': 'https://github.com/OCA/web/',
|
||||||
'category': 'Extra Tools',
|
'category': 'Extra Tools',
|
||||||
'version': '8.0.1.0.0',
|
'version': '10.0.1.0.0',
|
||||||
'depends': ['web'],
|
'depends': ['web'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/web_fullscreen_views.xml'
|
'views/web_fullscreen_view.xml'
|
||||||
],
|
],
|
||||||
'qweb': [
|
'qweb': [
|
||||||
'views/web_fullscreen_templates.xml'
|
'static/src/xml/*.xml'
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
.o_control_panel .o_cp_fullscreen {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 732 KiB |
|
@ -1,27 +1,17 @@
|
||||||
openerp.web_fullscreen = function(instance, local) {
|
odoo.define('web.fullscreen', function (require) {
|
||||||
var _t = instance.web._t,
|
"use strict";
|
||||||
_lt = instance.web._lt;
|
|
||||||
var QWeb = instance.web.qweb;
|
|
||||||
|
|
||||||
local.FullscreenButton = instance.Widget.extend({
|
var ControlPanel = require('web.ControlPanel');
|
||||||
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({
|
ControlPanel.include({
|
||||||
start: function () {
|
start: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
var btn = new local.FullscreenButton(this);
|
this.$el.on('click', '.o_cp_fullscreen', function () {
|
||||||
return btn.appendTo(this.$el.find('.oe_view_manager_switch'));
|
$("#oe_main_menu_navbar").toggle();
|
||||||
}
|
$(".o_sub_menu").toggle();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
});
|
||||||
|
/* eslint require-jsdoc: 0*/
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<templates xml:space="preserve">
|
|
||||||
<t t-name="FullscreenButton">
|
|
||||||
<li class="oe_e">
|
|
||||||
<a data-original-title="Fullscreen">ò</a>
|
|
||||||
</li>
|
|
||||||
</t>
|
|
||||||
</templates>
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<template id="assets_backend" name="web_fullscreen assets"
|
||||||
|
inherit_id="web.assets_backend">
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="/web_fullscreen/static/src/css/web_fullscreen.css"/>
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="/web_fullscreen/static/src/js/web_fullscreen.js"></script>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<openerp>
|
|
||||||
<data>
|
|
||||||
<template id="assets_backend" name="web_fullscreen assets" inherit_id="web.assets_backend">
|
|
||||||
<xpath expr="." position="inside">
|
|
||||||
<script type="text/javascript" src="/web_fullscreen/static/src/js/web_fullscreen.js"></script>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</data>
|
|
||||||
</openerp>
|
|
Loading…
Reference in New Issue