[Jifty-commit] jifty branch, master, updated. 1.10518-22-ga632c54
Jifty commits
jifty-commit at lists.jifty.org
Tue Jun 7 11:27:12 EDT 2011
The branch, master has been updated
via a632c54df8d893fca1dbafbbf528f48a6ed13e50 (commit)
from 4061cd0dd01153293d627f9246c344ac27a3ec1a (commit)
Summary of changes:
lib/Jifty/Web/Form/Element.pm | 7 ++++++-
share/web/static/js/jifty.js | 4 +++-
2 files changed, 9 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit a632c54df8d893fca1dbafbbf528f48a6ed13e50
Author: Thomas Sibley <trs at bestpractical.com>
Date: Tue Jun 7 11:26:20 2011 -0400
Don't require that Popout region links be in a region already or specify an element
This makes popouts much more developer-friendly.
diff --git a/lib/Jifty/Web/Form/Element.pm b/lib/Jifty/Web/Form/Element.pm
index e554a8b..0db9dab 100644
--- a/lib/Jifty/Web/Form/Element.pm
+++ b/lib/Jifty/Web/Form/Element.pm
@@ -462,7 +462,12 @@ sub _javascript_attrs_structure {
$hook->{element} ||= "#region-".$hook->{region};
} elsif (exists $hook->{popout}) {
@args{qw/mode path/} = ('Popout', $hook->{popout});
- $hook->{element} ||= "#region-".$hook->{region};
+ # Facebox always appends to its #facebox element, but that
+ # doesn't exist before the first use so we need something
+ # that's ever present. The value doesn't matter as long as it
+ # exists. Setting a value here means you can use Popout
+ # outside a region without specifying a value yourself.
+ $hook->{element} = "body";
} elsif (exists $hook->{replace_with}) {
if (defined $hook->{replace_with}) {
@args{qw/mode path region/} = ('Replace', $hook->{replace_with}, $hook->{region});
diff --git a/share/web/static/js/jifty.js b/share/web/static/js/jifty.js
index a17c4a8..585f535 100644
--- a/share/web/static/js/jifty.js
+++ b/share/web/static/js/jifty.js
@@ -1060,7 +1060,9 @@ var apply_fragment_updates = function(fragment, f) {
// Once we find it, do the insertion
if (f['mode'] == 'Popout') {
jQuery.facebox(textContent);
- element = document.getElementById('region-' + f['region']);
+ // Facebox always uses its #facebox element, so point to
+ // that regardless of what we were told earlier
+ element = document.getElementById('facebox');
} else if (f['mode'] && (f['mode'] != 'Replace')) {
var method = ({
After: 'after',
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list