From 55d7a8ef552fd63c22568b49d16b5adfd4a7a320 Mon Sep 17 00:00:00 2001 From: Jef Mathiot Date: Thu, 7 Nov 2013 18:11:41 +0100 Subject: [PATCH 1/2] Added a context option to the popup module to make its behavior closer to modal. --- server/documents/modules/popup.html.eco | 5 +++++ src/modules/popup.js | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/server/documents/modules/popup.html.eco b/server/documents/modules/popup.html.eco index c3644655a..2fa127a59 100755 --- a/server/documents/modules/popup.html.eco +++ b/server/documents/modules/popup.html.eco @@ -304,6 +304,11 @@ type : 'UI Module' Description + + context + body + Selector or jquery object specifying the area to dim + position top center diff --git a/src/modules/popup.js b/src/modules/popup.js index cd2d5642d..ed27ebc42 100755 --- a/src/modules/popup.js +++ b/src/modules/popup.js @@ -15,7 +15,6 @@ $.fn.popup = function(parameters) { var $allModules = $(this), $document = $(document), - $body = $('body'), moduleSelector = $allModules.selector || '', @@ -45,6 +44,7 @@ $.fn.popup = function(parameters) { moduleNamespace = 'module-' + namespace, $module = $(this), + $context = $(settings.context), $target = (settings.target) ? $(settings.target) : $module, @@ -173,7 +173,7 @@ $.fn.popup = function(parameters) { else { module.verbose('Appending popup element to body', $popup); $popup - .appendTo( $body ) + .appendTo( $context ) ; } $.proxy(settings.onCreate, $popup)(); @@ -239,7 +239,7 @@ $.fn.popup = function(parameters) { return ( $popup.size() !== 0 ); } else { - return ( $popup.parent($body).size() ); + return ( $popup.parent($context).size() ); } }, @@ -757,6 +757,7 @@ $.fn.popup.settings = { target : false, closable : true, + context : 'body', position : 'top center', delay : 150, inline : false, From eadb752105826bb9310ea31f86b35ba31b4345b6 Mon Sep 17 00:00:00 2001 From: Jef Mathiot Date: Thu, 7 Nov 2013 18:14:00 +0100 Subject: [PATCH 2/2] Modified documentation. --- server/documents/modules/popup.html.eco | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/documents/modules/popup.html.eco b/server/documents/modules/popup.html.eco index 2fa127a59..763808f10 100755 --- a/server/documents/modules/popup.html.eco +++ b/server/documents/modules/popup.html.eco @@ -307,7 +307,7 @@ type : 'UI Module' context body - Selector or jquery object specifying the area to dim + Selector or jquery object specifying where the popup should be created position