Skip to content

Commit

Permalink
[FIX+IMP] web_dialog_size
Browse files Browse the repository at this point in the history
* IMP: Added draggable support to dialogs
* FIX: web_dialog_size: export modal
  - PR OCA#733 introduced draggable dialogs which broke some of them
  • Loading branch information
wpichler authored and sudhir-erpharbor committed Oct 4, 2019
1 parent c09bf98 commit ebc473a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
35 changes: 31 additions & 4 deletions web_dialog_size/README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

=============
Expand Dialog
=============

A module that lets the user expand/restore the dialog box size through a button
in the upper right corner (mimicking most windows managers).
It does also add draggable support to the dialogs.

Configuration
=============
Expand All @@ -11,29 +17,50 @@ 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
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
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Anthony Muschang <[email protected]>
* Stéphane Bidoul <[email protected]>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Holger Brunn <[email protected]>
* Siddharth Bhalgami <[email protected]>
* Wolfgang Pichler <[email protected]>
* David Vidal <[email protected]>

Do not contact contributors directly about support or help with technical issues.

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://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.
To contribute to this module, please visit https://odoo-community.org.
12 changes: 4 additions & 8 deletions web_dialog_size/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@

{
'name': "Web Dialog Size",

'summary': """
A module that lets the user expand a
dialog box to the full screen width.""",

'author': "ACSONE SA/NV, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Therp BV, "
"Odoo Community Association (OCA), "
"Siddharth Bhalgami",

"Siddharth Bhalgami,"
"Tecnativa, "
"Odoo Community Association (OCA)",
'website': "http://acsone.eu",
'category': 'web',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'license': 'AGPL-3',

'depends': [
'web',
],
Expand Down
20 changes: 19 additions & 1 deletion web_dialog_size/static/src/js/web_dialog_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,32 @@ Dialog.include({

new Model('ir.config_parameter').query(['key', 'value']).
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();
} else {
self._restore();
}
});
},

open: function() {
var res = this._super.apply(this, arguments);
this.$modal.draggable({
handle: '.modal-header',
helper: false
});
return res;
},

close: function() {
var draggable = this.$modal.draggable( "instance" );
if (draggable) {
this.$modal.draggable("destroy");
}
var res = this._super.apply(this, arguments);
return res;
},

_extending: function() {
var dialog = this.$modal.find('.modal-dialog');
dialog.addClass('dialog_full_screen');
Expand Down

0 comments on commit ebc473a

Please sign in to comment.