[IMP] web_dialog_size: black, isort, prettier

pull/3042/head
Pierre Pizzetta 2020-10-16 12:59:24 +08:00 committed by jguerriat
parent 077550d22e
commit cb16e42796
2 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"website": "http://github.com/OCA/web", "website": "http://github.com/OCA/web",
"category": "web", "category": "web",
"version": "13.0.1.0.0", "version": "14.0.1.0.0",
"license": "AGPL-3", "license": "AGPL-3",
"depends": ["web"], "depends": ["web"],
"qweb": ["static/src/xml/web_dialog_size.xml"], "qweb": ["static/src/xml/web_dialog_size.xml"],

View File

@ -1,4 +1,4 @@
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");
@ -10,16 +10,16 @@ odoo.define("web_dialog_size.web_dialog_size", function(require) {
}); });
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 self.$modal
.find(".dialog_button_extend") .find(".dialog_button_extend")
.on("click", self.proxy("_extending")); .on("click", self.proxy("_extending"));
self.$modal self.$modal
.find(".dialog_button_restore") .find(".dialog_button_restore")
.on("click", self.proxy("_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 {
@ -29,9 +29,9 @@ odoo.define("web_dialog_size.web_dialog_size", function(require) {
}); });
}, },
opened: function() { opened: function () {
return this._super.apply(this, arguments).then( return this._super.apply(this, arguments).then(
function() { function () {
if (this.$modal) { if (this.$modal) {
this.$modal.draggable({ this.$modal.draggable({
handle: ".modal-header", handle: ".modal-header",
@ -42,7 +42,7 @@ odoo.define("web_dialog_size.web_dialog_size", function(require) {
); );
}, },
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) {
@ -52,14 +52,14 @@ 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();