You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pierce Wetter <pi...@paceap.com> on 2010/06/02 22:53:16 UTC

Scrolling to make sure that a Zone is visible

   It doesn't seem like the default zone update functions will ensure that the browser scrolls to show a zone. 

    Ex:
              <t:zone t:id="popupZoneCurrentEmployee">
            </t:zone>

    I have that zone at the bottom of a long table, if you click at the top of a table, the zone gets populated, but you might not notice. 

   I was able to implement scrolling with some relatively trivial javascript at the top of the block I use to fill the zone:
            <t:block t:id="employeeBlock">
                <script> 
				document.location.hash=""; // this line is needed or a second click won't scroll
				document.location.hash="popupZoneCurrentEmployee";
		</script>
             
   I was wondering if:

        a. I'm doing something wrong.
        b. If I should contribute some sort of "scroll" effect to Tapestry.ElementEffect.
        c. If Zone should just get a new parameter: scroll, if set to true it will emit the above code in addition to the transition.

 Pierce


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Scrolling to make sure that a Zone is visible

Posted by Pierce Wetter <pi...@paceap.com>.
>>       b. If I should contribute some sort of "scroll" effect to Tapestry.ElementEffect.
> 
> I'd pick this route, then you can just set the "show" attribute to
> "scroll" in whatever zones you want to have this behavior and not
> duplicate the code.  You might want to use
> http://www.prototypejs.org/api/element/scrollto instead of the
> location.hash method.
> 
>>       c. If Zone should just get a new parameter: scroll, if set to true it will emit the above code in addition to the transition.
> 
> Personally I don't think this calls for a new parameter.

  The logic for having a new parameter would be that you would want to combine them, that you would want:

   scrollTo();

   to happen BEFORE the effect. Otherwise then you need a pre-scrolling variant of each effect, which seems like a lot. 

   Using prototype scrollTo() seems to lock us more into ProtoType when my designer want's to use jQuery...

 Pierce
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Scrolling to make sure that a Zone is visible

Posted by Josh Canfield <jo...@gmail.com>.
>   It doesn't seem like the default zone update functions will ensure that the browser scrolls to show a zone.

Right, that'd be something you'd want to implement yourself.

>        b. If I should contribute some sort of "scroll" effect to Tapestry.ElementEffect.

I'd pick this route, then you can just set the "show" attribute to
"scroll" in whatever zones you want to have this behavior and not
duplicate the code.  You might want to use
http://www.prototypejs.org/api/element/scrollto instead of the
location.hash method.

>        c. If Zone should just get a new parameter: scroll, if set to true it will emit the above code in addition to the transition.

Personally I don't think this calls for a new parameter.

Josh

On Wed, Jun 2, 2010 at 1:53 PM, Pierce Wetter <pi...@paceap.com> wrote:
>
>   It doesn't seem like the default zone update functions will ensure that the browser scrolls to show a zone.
>
>    Ex:
>              <t:zone t:id="popupZoneCurrentEmployee">
>            </t:zone>
>
>    I have that zone at the bottom of a long table, if you click at the top of a table, the zone gets populated, but you might not notice.
>
>   I was able to implement scrolling with some relatively trivial javascript at the top of the block I use to fill the zone:
>            <t:block t:id="employeeBlock">
>                <script>
>                                document.location.hash=""; // this line is needed or a second click won't scroll
>                                document.location.hash="popupZoneCurrentEmployee";
>                </script>
>
>   I was wondering if:
>
>        a. I'm doing something wrong.
>        b. If I should contribute some sort of "scroll" effect to Tapestry.ElementEffect.
>        c. If Zone should just get a new parameter: scroll, if set to true it will emit the above code in addition to the transition.
>
>  Pierce
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org