Skip to content

Commit

Permalink
Merge PR #2843 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jun 11, 2024
2 parents e87080d + 783536a commit 29cee78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
31 changes: 6 additions & 25 deletions web_dialog_size/static/src/js/web_dialog_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ odoo.define("web_dialog_size.web_dialog_size", function (require) {
self.$modal
.find(".dialog_button_restore")
.on("click", self.proxy("_restore"));
self.$modal.find(">:first-child").draggable({
handle: ".modal-header",
helper: false,
});
return config.then(function (r) {
if (r.default_maximize) {
self._extending();
Expand All @@ -29,39 +33,16 @@ 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.find(">:first-child").draggable({
handle: ".modal-header",
helper: false,
});
}
}.bind(this)
);
},

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

_extending: function () {
var dialog = this.$modal.find(".modal-dialog");
dialog.addClass("dialog_full_screen");
dialog.addClass("modal-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.removeClass("modal-dialog_full_screen");
dialog.find(".dialog_button_restore").hide();
dialog.find(".dialog_button_extend").show();
},
Expand Down
3 changes: 0 additions & 3 deletions web_dialog_size/static/src/xml/web_dialog_size.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<!-- This is for old Dialog template.
Because Odoo haven't done every template to OWL. -->
<t t-extend="web.DialogWidget">
<t t-jquery="button.btn-close" t-operation="inner">
<i class="fa fa-close" />
</t>
<t t-jquery="button.btn-close" t-operation="before">
<button type="button" class="dialog_button_extend btn btn-secondary">
<i class="fa fa-expand" />
Expand Down

0 comments on commit 29cee78

Please sign in to comment.