From 5c6952537eedd6204f82d049eac0eef104b70108 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Sat, 7 Mar 2015 17:51:56 +0100 Subject: [PATCH] [gen] Nice rendering of popups within popups. --- gen/ui/appy.css | 5 ++--- gen/ui/appy.js | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 4f7eba5..4c8e8c9 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -102,9 +102,8 @@ input.buttonFixed { width:110px; padding: 0 0 0 10px } td.search { padding-top: 8px } .searchFields { width: 100%; margin-bottom: 8px } .content { padding: 9px; background-color: #fbfbfb } -.popup { display: none; position: absolute; top: 30%; left: 35%; - width: 350px; z-index : 100; background: white; padding: 8px; - border: 1px solid grey; box-shadow: 2px 2px 2px #888888} +.popup { display: none; position: absolute; z-index : 100; background: white; + padding: 8px; border: 1px solid grey; box-shadow: 2px 2px 2px #888888} .dropdown { display:none; position: absolute; top: 12px; left: 1px; border: 1px solid #cccccc; background-color: white; padding: 3px 4px 3px; font-size: 8pt; font-weight: normal; diff --git a/gen/ui/appy.js b/gen/ui/appy.js index c895174..9064015 100644 --- a/gen/ui/appy.js +++ b/gen/ui/appy.js @@ -894,20 +894,21 @@ function openPopup(popupId, msg, width, height, back) { // Open the popup var popup = document.getElementById(popupId); // Put it at the right place on the screen and give it the right dimensions + if (!width) { + width = (popupId == 'iframePopup')? window.innerWidth-200: 350; + } var scrollTop = document.documentElement.scrollTop || window.pageYOffset || 0; popup.style.top = (scrollTop + 150) + 'px'; - if (width) popup.style.width = width + 'px'; + popup.style.width = width + 'px'; + popup.style.left = ((window.innerWidth - width) / 2).toFixed() + 'px'; if (height) popup.style.height = height + 'px'; if (popupId == 'iframePopup') { // Initialize iframe's width var iframe = document.getElementById('appyIFrame'); - if (!width) width = window.innerWidth - 200; if (!height) { height = window.innerHeight - 200; popup.style.top = ((window.innerHeight - height) / 2).toFixed() + 'px'; } - popup.style.left = ((window.innerWidth - width) / 2).toFixed() + 'px'; - popup.style.width = width + 'px'; iframe.style.width = (width-20) + 'px'; popup.style.height = height + 'px'; iframe.style.height = (height-20) + 'px';