Browse Source

Added a context option to the popup module to make its behavior closer to modal.

pull/335/head
Jef Mathiot 11 years ago
parent
commit
55d7a8ef55
2 changed files with 9 additions and 3 deletions
  1. 5
      server/documents/modules/popup.html.eco
  2. 7
      src/modules/popup.js

5
server/documents/modules/popup.html.eco

@ -304,6 +304,11 @@ type : 'UI Module'
<th>Description</th>
</thead>
<tbody>
<tr>
<td>context</td>
<td>body</td>
<td>Selector or jquery object specifying the area to dim</td>
</tr>
<tr>
<td>position</td>
<td>top center</td>

7
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,

Loading…
Cancel
Save