From ffcd0e8a4a8b637440d84bd69e513bdfa739e1c4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 18 Jan 2017 08:09:32 +0100 Subject: [PATCH 1/3] add style for span.closepopupbox --- styles/bootstrap/application.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index 413ce0ce7..ba0203cfd 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -185,7 +185,13 @@ div.popupbox { padding: 15px; display: none; position: absolute; - width: 200px; + width: 250px; +} + +div.popupbox span.closepopupbox { + position: absolute; + right: 5px; + top: 0px; } @media (max-width: 480px) { From 3dcf867634fd9ae97ed76009175a91c2786c0d46 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 18 Jan 2017 08:09:50 +0100 Subject: [PATCH 2/3] add code to open and close popup box --- styles/bootstrap/application.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 037f2731b..c67376d3f 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -989,9 +989,10 @@ $(document).ready(function() { /* {{{ */ }); }); - $('span.openpopupbox').on('click', function(e) { - $('div.popupbox').toggle(); - console.log('Hallo'); + $("body").on("click", "span.openpopupbox", function(e) { + $(""+$(e.target).data("href")).toggle(); + }); + $("body").on("click", "span.closepopupbox", function(e) { + $(this).parent().hide(); }); - }); /* }}} */ From b8d4d12f4edb8d3f6dfe88daa887a9a8e8cc96c9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 18 Jan 2017 08:10:21 +0100 Subject: [PATCH 3/3] allow to place several popup boxes on a page --- views/bootstrap/class.Bootstrap.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 4fdb6c90c..0beca50f7 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2443,10 +2443,20 @@ mayscript> } /* }}} */ protected function printPopupBox($title, $content, $ret=false) { /* {{{ */ + $id = md5(uniqid()); + /* + $this->addFooterJS(' +$("body").on("click", "span.openpopupbox", function(e) { + $(""+$(e.target).data("href")).toggle(); +// $("div.popupbox").toggle(); +}); +'); + */ $html = ' - '.$title.' -