3
0
Fork 0

[IMP] pre-commit run after update

Includes some manual fixes to silent ESLint warnings.
17.0
Jairo Llopis 2020-01-24 13:45:39 +00:00 committed by Carlos Roca
parent 6d5156af44
commit ad37c8252b
4 changed files with 60 additions and 47 deletions

View File

@ -1,26 +1,25 @@
odoo.define('web_dialog_size.web_dialog_size', function (require) { odoo.define("web_dialog_size.web_dialog_size", function(require) {
'use strict'; "use strict";
var rpc = require('web.rpc'); var rpc = require("web.rpc");
var Dialog = require('web.Dialog'); var Dialog = require("web.Dialog");
var config = rpc.query({ var config = rpc.query({
model: 'ir.config_parameter', model: "ir.config_parameter",
method: 'get_web_dialog_size_config', method: "get_web_dialog_size_config",
}); });
Dialog.include({ Dialog.include({
willStart: function() {
willStart: function () {
var self = this; var self = this;
return this._super.apply(this, arguments).then(function () { return this._super.apply(this, arguments).then(function() {
self.$modal.find('.dialog_button_extend').on('click', self.$modal
self.proxy('_extending') .find(".dialog_button_extend")
); .on("click", self.proxy("_extending"));
self.$modal.find('.dialog_button_restore').on('click', self.$modal
self.proxy('_restore') .find(".dialog_button_restore")
); .on("click", self.proxy("_restore"));
return config.then(function (r) { return config.then(function(r) {
if (r.default_maximize) { if (r.default_maximize) {
self._extending(); self._extending();
} else { } else {
@ -30,18 +29,20 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
}); });
}, },
opened: function () { opened: function() {
return this._super.apply(this, arguments).then(function () { return this._super.apply(this, arguments).then(
if (this.$modal) { function() {
this.$modal.draggable({ if (this.$modal) {
handle: '.modal-header', this.$modal.draggable({
helper: false, handle: ".modal-header",
}); helper: false,
} });
}.bind(this)); }
}.bind(this)
);
}, },
close: function () { close: function() {
if (this.$modal) { if (this.$modal) {
var draggable = this.$modal.draggable("instance"); var draggable = this.$modal.draggable("instance");
if (draggable) { if (draggable) {
@ -51,20 +52,18 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
_extending: function () { _extending: function() {
var dialog = this.$modal.find('.modal-dialog'); var dialog = this.$modal.find(".modal-dialog");
dialog.addClass('dialog_full_screen'); dialog.addClass("dialog_full_screen");
dialog.find('.dialog_button_extend').hide(); dialog.find(".dialog_button_extend").hide();
dialog.find('.dialog_button_restore').show(); dialog.find(".dialog_button_restore").show();
}, },
_restore: function () { _restore: function() {
var dialog = this.$modal.find('.modal-dialog'); var dialog = this.$modal.find(".modal-dialog");
dialog.removeClass('dialog_full_screen'); dialog.removeClass("dialog_full_screen");
dialog.find('.dialog_button_restore').hide(); dialog.find(".dialog_button_restore").hide();
dialog.find('.dialog_button_extend').show(); dialog.find(".dialog_button_extend").show();
}, },
}); });
}); });

View File

@ -1,4 +1,3 @@
.modal { .modal {
.dialog_full_screen { .dialog_full_screen {
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
@ -15,7 +14,8 @@
} }
} }
&.dialog_button_extend, .dialog_button_restore { &.dialog_button_extend,
.dialog_button_restore {
@include media-breakpoint-down(sm) { @include media-breakpoint-down(sm) {
display: none !important; display: none !important;
} }

View File

@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-extend="Dialog"> <t t-extend="Dialog">
<t t-jquery="button.close" t-operation="inner"> <t t-jquery="button.close" t-operation="inner">
<i class="fa fa-close" /> <i class="fa fa-close" />
</t> </t>
<t t-jquery="button.close" t-operation="before"> <t t-jquery="button.close" t-operation="before">
<button type="button" class="dialog_button_extend close"><i class="fa fa-expand" /></button> <button type="button" class="dialog_button_extend close"><i
<button type="button" class="dialog_button_restore close"><i class="fa fa-compress" /></button> class="fa fa-expand"
/></button>
<button type="button" class="dialog_button_restore close"><i
class="fa fa-compress"
/></button>
</t> </t>
</t> </t>
</templates> </templates>

View File

@ -1,9 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<template id="assets_backend" name="web_dialog_size assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="web_dialog_size assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/web_dialog_size/static/src/scss/web_dialog_size.scss"/> <link
<script type="text/javascript" src="/web_dialog_size/static/src/js/web_dialog_size.js"></script> rel="stylesheet"
href="/web_dialog_size/static/src/scss/web_dialog_size.scss"
/>
<script
type="text/javascript"
src="/web_dialog_size/static/src/js/web_dialog_size.js"
/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>