mirror of https://github.com/OCA/web.git
[IMP] pre-commit run after update
Includes some manual fixes to silent ESLint warnings.pull/1709/head
parent
abaca8693c
commit
8ecc7f998c
|
@ -1,26 +1,25 @@
|
|||
odoo.define('web_dialog_size.web_dialog_size', function (require) {
|
||||
'use strict';
|
||||
odoo.define("web_dialog_size.web_dialog_size", function(require) {
|
||||
"use strict";
|
||||
|
||||
var rpc = require('web.rpc');
|
||||
var Dialog = require('web.Dialog');
|
||||
var rpc = require("web.rpc");
|
||||
var Dialog = require("web.Dialog");
|
||||
|
||||
var config = rpc.query({
|
||||
model: 'ir.config_parameter',
|
||||
method: 'get_web_dialog_size_config',
|
||||
model: "ir.config_parameter",
|
||||
method: "get_web_dialog_size_config",
|
||||
});
|
||||
|
||||
Dialog.include({
|
||||
|
||||
willStart: function () {
|
||||
willStart: function() {
|
||||
var self = this;
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
self.$modal.find('.dialog_button_extend').on('click',
|
||||
self.proxy('_extending')
|
||||
);
|
||||
self.$modal.find('.dialog_button_restore').on('click',
|
||||
self.proxy('_restore')
|
||||
);
|
||||
return config.then(function (r) {
|
||||
return this._super.apply(this, arguments).then(function() {
|
||||
self.$modal
|
||||
.find(".dialog_button_extend")
|
||||
.on("click", self.proxy("_extending"));
|
||||
self.$modal
|
||||
.find(".dialog_button_restore")
|
||||
.on("click", self.proxy("_restore"));
|
||||
return config.then(function(r) {
|
||||
if (r.default_maximize) {
|
||||
self._extending();
|
||||
} else {
|
||||
|
@ -30,18 +29,20 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
|
|||
});
|
||||
},
|
||||
|
||||
opened: function () {
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
if (this.$modal) {
|
||||
this.$modal.draggable({
|
||||
handle: '.modal-header',
|
||||
helper: false,
|
||||
});
|
||||
}
|
||||
}.bind(this));
|
||||
opened: function() {
|
||||
return this._super.apply(this, arguments).then(
|
||||
function() {
|
||||
if (this.$modal) {
|
||||
this.$modal.draggable({
|
||||
handle: ".modal-header",
|
||||
helper: false,
|
||||
});
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
},
|
||||
|
||||
close: function () {
|
||||
close: function() {
|
||||
if (this.$modal) {
|
||||
var draggable = this.$modal.draggable("instance");
|
||||
if (draggable) {
|
||||
|
@ -51,20 +52,18 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
|
|||
return this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
_extending: function () {
|
||||
var dialog = this.$modal.find('.modal-dialog');
|
||||
dialog.addClass('dialog_full_screen');
|
||||
dialog.find('.dialog_button_extend').hide();
|
||||
dialog.find('.dialog_button_restore').show();
|
||||
_extending: function() {
|
||||
var dialog = this.$modal.find(".modal-dialog");
|
||||
dialog.addClass("dialog_full_screen");
|
||||
dialog.find(".dialog_button_extend").hide();
|
||||
dialog.find(".dialog_button_restore").show();
|
||||
},
|
||||
|
||||
_restore: function () {
|
||||
var dialog = this.$modal.find('.modal-dialog');
|
||||
dialog.removeClass('dialog_full_screen');
|
||||
dialog.find('.dialog_button_restore').hide();
|
||||
dialog.find('.dialog_button_extend').show();
|
||||
_restore: function() {
|
||||
var dialog = this.$modal.find(".modal-dialog");
|
||||
dialog.removeClass("dialog_full_screen");
|
||||
dialog.find(".dialog_button_restore").hide();
|
||||
dialog.find(".dialog_button_extend").show();
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
.modal {
|
||||
.dialog_full_screen {
|
||||
@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) {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="Dialog">
|
||||
<t t-jquery="button.close" t-operation="inner">
|
||||
<i class="fa fa-close" />
|
||||
</t>
|
||||
<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_restore close"><i class="fa fa-compress" /></button>
|
||||
<button type="button" class="dialog_button_extend close"><i
|
||||
class="fa fa-expand"
|
||||
/></button>
|
||||
<button type="button" class="dialog_button_restore close"><i
|
||||
class="fa fa-compress"
|
||||
/></button>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<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">
|
||||
<link 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"></script>
|
||||
<link
|
||||
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>
|
||||
</template>
|
||||
</odoo>
|
||||
|
|
Loading…
Reference in New Issue