Skip to content
Snippets Groups Projects
Commit 1ab86fd9 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

CIP #57952 improve popup opening and revive resize

parent 2ca2e981
Branches
Tags
2 merge requests!2334Master,!2079Dev#57952 cip priorisation des ecrans de config
Pipeline #1105 passed with stage
in 10 minutes and 38 seconds
......@@ -77,18 +77,4 @@ a[data-popup="true"].image-loading-status {
a[data-popup="true"].image-loading-status img {
visibility: hidden;
}
.ui-dialog {
height: 0 !important;
}
.ui-dialog.fixed_popup {
position: fixed !important;
}
.ui-dialog.fixed_popup,
.ui-dialog.fixed_popup > * {
height: auto !important;
}
}
\ No newline at end of file
......@@ -29,19 +29,6 @@ body .ui-widget-content {
padding: 0;
}
body .ui-dialog {
height: 0 !important;
}
body .ui-dialog.fixed_popup {
position: fixed !important;
}
body .ui-dialog.fixed_popup,
body .ui-dialog.fixed_popup > * {
height: auto !important;
}
body .ui-dialog {
box-shadow: 0 0 15px var(--widget-shadow);
border: 2px solid var(--nav-background);
......
......@@ -3,6 +3,7 @@
var popupDialog = null;
var loading = 'image-loading-status';
var current_anchor;
var opac_dialog = null;
window.initializePopups = function() {
$('[data-popup="true"]')
......@@ -75,14 +76,11 @@
var onOpen = function(event, ui) {
initializePopups();
addLoadingClass();
var popup = $(event.target).closest('.ui-widget');
popup.addClass('fixed_popup');
if((parseInt(popup.css('top')) > 500) || (parseInt(popup.css('top')) < 1))
popup.css('top', '25%');
if(parseInt(popup.css('left')) < 1)
popup.css('left', '25%');
opac_dialog = $(event.target).closest('.ui-widget');
opac_dialog.css('position', 'fixed');
opac_dialog.css('top', '15%');
opac_dialog.css('left', '20%');
opac_dialog.css('width', '60%');
}
......@@ -161,15 +159,19 @@
var modal = container.dialog({
title: data['title'],
width: 'auto',
height: 'auto',
modal:show_modal,
position: {'my': 'center bottom', 'at': 'center center', 'of': window},
close: function(event, ui) {
onClose(event, ui)
},
open: function(event, ui) {
setTimeout(onOpen(event, ui), 100);
},
resizeStart: function(event, ui) {
opac_dialog.css('position', 'absolute');
},
resizeStop: function(event, ui) {
opac_dialog.css('position', 'fixed');
opac_dialog.position({of: $(window)});
}
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment