[Jifty-commit] jifty branch, master, updated. 1.10518-40-gc14c88c

Jifty commits jifty-commit at lists.jifty.org
Wed Aug 3 12:47:18 EDT 2011


The branch, master has been updated
       via  c14c88cf97851d9c6f2157f0b7acdb9bb5ea762f (commit)
      from  b562c7efe95b9df2ae009697d828f8f4da021ba7 (commit)

Summary of changes:
 lib/Jifty/Web/Form/Element.pm |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit c14c88cf97851d9c6f2157f0b7acdb9bb5ea762f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Aug 3 12:45:59 2011 -0400

    Jifty.update supports before/after region insertion modes, so form elements should too
    
    While we're at it, clarify the documentation around append/prepend and
    before/after.

diff --git a/lib/Jifty/Web/Form/Element.pm b/lib/Jifty/Web/Form/Element.pm
index 0db9dab..165441e 100644
--- a/lib/Jifty/Web/Form/Element.pm
+++ b/lib/Jifty/Web/Form/Element.pm
@@ -29,15 +29,23 @@ specified by providing at most one of the following keys:
 
 =item append => PATH
 
-Add the given C<PATH> as a new fragment, just before the close of the
-CSS selector given by L</element>, which defaults to the end of the
-current region.
+Add the given C<PATH> as a new fragment at the end within the element
+specified by the CSS selector in L</element>.
 
 =item prepend => PATH
 
-Add the given C<PATH> as a new fragment, just after the start of the
-CSS selector given by L</element>, which defaults to the start of the
-current region.
+Add the given C<PATH> as a new fragment at the start within the element
+specified by the CSS selector in L</element>.
+
+=item before => PATH
+
+Add the given C<PATH> as a new fragment immediately before the element
+specified by the CSS selector in L</element>.
+
+=item after => PATH
+
+Add the given C<PATH> as a new fragment immediately after the element
+specified by the CSS selector in L</element>.
 
 =item popout => PATH
 
@@ -83,10 +91,12 @@ region.
 =item element => CSS SELECTOR
 
 A css selector specifying where the new region should be placed; used
-with L</append> and L</prepend>, above.  The
+with L</append>, L</prepend>, L</before>, and L</after> above.  The
 L<Jifty::Web::PageRegion/get_element> method may be useful in
 specifying elements of parent page regions.
 
+Defaults to the current region.
+
 =item submit => MONIKER
 
 A Jifty::Action, Jifty::Action moniker, hashref of 
@@ -460,6 +470,12 @@ sub _javascript_attrs_structure {
             } elsif (exists $hook->{prepend}) {
                 @args{qw/mode path/} = ('Top', $hook->{prepend});
                 $hook->{element} ||= "#region-".$hook->{region};
+            } elsif (exists $hook->{before}) {
+                @args{qw/mode path/} = ('Before', $hook->{before});
+                $hook->{element} ||= "#region-".$hook->{region};
+            } elsif (exists $hook->{after}) {
+                @args{qw/mode path/} = ('After', $hook->{after});
+                $hook->{element} ||= "#region-".$hook->{region};
             } elsif (exists $hook->{popout}) {
                 @args{qw/mode path/} = ('Popout', $hook->{popout});
                 # Facebox always appends to its #facebox element, but that

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list