mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_responsive: Migration to 16.0
Fix for optional dropdown checkbox in list view Made Changes for compatibility with web_chatter_position module Fix for attachment delete dialog
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
/** @odoo-module **/
|
||||
/* Copyright 2021 ITerra - Sergey Shebanin
|
||||
* Copyright 2023 Onestein - Anjeel Haria
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
import {AttachmentViewer} from "@mail/components/attachment_viewer/attachment_viewer";
|
||||
import {patch} from "web.utils";
|
||||
|
||||
const {useState} = owl.hooks;
|
||||
import {registerPatch} from "@mail/model/model_core";
|
||||
const {useState} = owl;
|
||||
|
||||
// Patch attachment viewer to add min/max buttons capability
|
||||
patch(AttachmentViewer.prototype, "web_responsive.AttachmentViewer", {
|
||||
@@ -15,8 +16,22 @@ patch(AttachmentViewer.prototype, "web_responsive.AttachmentViewer", {
|
||||
maximized: false,
|
||||
});
|
||||
},
|
||||
// Disable auto-close to allow to use form in edit mode.
|
||||
isCloseable() {
|
||||
return false;
|
||||
});
|
||||
|
||||
registerPatch({
|
||||
name: "Dialog",
|
||||
fields: {
|
||||
isCloseable: {
|
||||
compute() {
|
||||
if (this.attachmentViewer) {
|
||||
/**
|
||||
* Prevent closing the dialog when clicking on the mask when the user is
|
||||
* currently dragging the image.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
return this._super();
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
// Attachment Viewer
|
||||
.o_web_client.o_chatter_position_sided .o_DialogManager_dialog {
|
||||
.o_web_client .o_DialogManager_dialog {
|
||||
/* Show sided viewer on large screens */
|
||||
@include media-breakpoint-up(lg) {
|
||||
position: static;
|
||||
@media (min-width: 1533px) {
|
||||
&:not(:has(.o_AttachmentDeleteConfirm)) {
|
||||
position: static;
|
||||
}
|
||||
.o_AttachmentViewer_main {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
@@ -22,7 +24,7 @@
|
||||
|
||||
width: $chatter_zone_width;
|
||||
&.o_AttachmentViewer_maximized {
|
||||
width: 100%;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* Show/Hide control buttons (next, prev, etc..) */
|
||||
@@ -39,18 +41,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-down(md) {
|
||||
@media (max-width: 1533px) {
|
||||
.o_AttachmentViewer_headerItemButtonMinimize,
|
||||
.o_AttachmentViewer_headerItemButtonMaximize {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Attachment Viewer Max/Min buttons only are useful in sided mode */
|
||||
.o_web_client:not(.o_chatter_position_sided) {
|
||||
.o_FormRenderer_chatterContainer:not(.o-aside) {
|
||||
.o_AttachmentViewer_headerItemButtonMinimize,
|
||||
.o_AttachmentViewer_headerItemButtonMaximize {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.o_apps_menu_opened .o_AttachmentViewer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
>
|
||||
<div
|
||||
t-if="!state.maximized"
|
||||
class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMaximize"
|
||||
t-on-click="state.maximized=true"
|
||||
class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMaximize d-flex align-items-center mb-0 px-3 h4 text-reset cursor-pointer"
|
||||
t-on-click="() => { state.maximized = true }"
|
||||
role="button"
|
||||
title="Maximize"
|
||||
aria-label="Maximize"
|
||||
@@ -26,8 +26,8 @@
|
||||
</div>
|
||||
<div
|
||||
t-if="state.maximized"
|
||||
class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMinimize"
|
||||
t-on-click="state.maximized=false"
|
||||
class="o_AttachmentViewer_headerItem o_AttachmentViewer_headerItemButton o_AttachmentViewer_headerItemButtonMinimize d-flex align-items-center mb-0 px-3 h4 text-reset cursor-pointer"
|
||||
t-on-click="() => { state.maximized = false }"
|
||||
role="button"
|
||||
title="Minimize"
|
||||
aria-label="Minimize"
|
||||
|
||||
Reference in New Issue
Block a user