Browse Source

[10.0][FIX] web_dialog_size: export modal (#746)

* [10.0][FIX] web_dialog_size: export modal

- PR #733 introduced draggable dialogs wich broke some of them
pull/869/head
David Vidal 7 years ago
committed by Pedro M. Baeza
parent
commit
983b98b4c9
  1. 33
      web_dialog_size/README.rst
  2. 12
      web_dialog_size/__manifest__.py
  3. 8
      web_dialog_size/static/src/js/web_dialog_size.js

33
web_dialog_size/README.rst

@ -1,3 +1,8 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
=============
Expand Dialog Expand Dialog
============= =============
@ -12,25 +17,45 @@ By default, the module respects the caller's `dialog_size` option. If you want
to override this and have all dialogs maximized by default, set the configuration to override this and have all dialogs maximized by default, set the configuration
parameter `web_dialog_size.default_maximize` to `1`. parameter `web_dialog_size.default_maximize` to `1`.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/web/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits Credits
======= =======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors Contributors
------------ ------------
* Anthony Muschang <anthony.muschang@acsone.eu> * Anthony Muschang <anthony.muschang@acsone.eu>
* Stéphane Bidoul <stephane.bidoul@acsone.eu> * Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Holger Brunn <hbrunn@therp.nl> * Holger Brunn <hbrunn@therp.nl>
* Siddharth Bhalgami <siddharth.bhalgami@gmail.com> * Siddharth Bhalgami <siddharth.bhalgami@gmail.com>
* Wolfgang Pichler <wpichler@callino.at> * Wolfgang Pichler <wpichler@callino.at>
* David Vidal <david.vidal@tecnativa.com>
Do not contact contributors directly about support or help with technical issues.
Maintainer Maintainer
---------- ----------
.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association :alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://odoo-community.org
This module is maintained by the OCA. This module is maintained by the OCA.
@ -38,4 +63,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.

12
web_dialog_size/__manifest__.py

@ -4,22 +4,18 @@
{ {
'name': "Web Dialog Size", 'name': "Web Dialog Size",
'summary': """ 'summary': """
A module that lets the user expand a A module that lets the user expand a
dialog box to the full screen width.""", dialog box to the full screen width.""",
'author': "ACSONE SA/NV, " 'author': "ACSONE SA/NV, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Therp BV, " "Therp BV, "
"Odoo Community Association (OCA), "
"Siddharth Bhalgami",
"Siddharth Bhalgami,"
"Tecnativa, "
"Odoo Community Association (OCA)",
'website': "http://acsone.eu", 'website': "http://acsone.eu",
'category': 'web', 'category': 'web',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': [ 'depends': [
'web', 'web',
], ],

8
web_dialog_size/static/src/js/web_dialog_size.js

@ -14,7 +14,7 @@ Dialog.include({
new Model('ir.config_parameter').query(['key', 'value']). new Model('ir.config_parameter').query(['key', 'value']).
filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) { filter([['key', '=', 'web_dialog_size.default_maximize']]).all().then(function(default_maximize) {
if (default_maximize.length && default_maximize[0]['value'] == 1) {
if (default_maximize.length && default_maximize[0].value === 1) {
self._extending(); self._extending();
} else { } else {
self._restore(); self._restore();
@ -25,15 +25,17 @@ Dialog.include({
open: function() { open: function() {
var res = this._super.apply(this, arguments); var res = this._super.apply(this, arguments);
this.$modal.draggable({ this.$modal.draggable({
handle: "div.modal-header",
handle: '.modal-header',
helper: false
}); });
return res; return res;
}, },
close: function() { close: function() {
var draggable = this.$modal.draggable( "instance" ); var draggable = this.$modal.draggable( "instance" );
if (draggable)
if (draggable) {
this.$modal.draggable("destroy"); this.$modal.draggable("destroy");
}
var res = this._super.apply(this, arguments); var res = this._super.apply(this, arguments);
return res; return res;
}, },

Loading…
Cancel
Save