tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (TAP5-1775) Improve javascript performance while creating zone events
Date Thu, 25 Jul 2013 21:07:48 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1775?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Howard M. Lewis Ship closed TAP5-1775.
--------------------------------------

       Resolution: Invalid
    Fix Version/s: 5.4

This performance issues here have been addressed by the client-side overhaul in Tapestry 5.4.
                
> Improve javascript performance while creating zone events
> ---------------------------------------------------------
>
>                 Key: TAP5-1775
>                 URL: https://issues.apache.org/jira/browse/TAP5-1775
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Pedro Ayala
>              Labels: javascript, performance
>             Fix For: 5.4
>
>         Attachments: changes.patch
>
>
> While creating eventLinks and actionLinks it is necessary to call updateZoneOnEvent to
create the observe and store the zoneId in the element for future references.
> The method is also checking if the zoneId exist before storing it in the element store
information. While this feature is quite useful in debug mode, it is also consuming some time
in production mode.
> With this patch we will prevent the check while running in production mode, this improve
performance in older browser like internet explorer 7.
> Index: src/main/resources/org/apache/tapestry5/tapestry.js
> ===================================================================
> --- src/main/resources/org/apache/tapestry5/tapestry.js
> +++ src/main/resources/org/apache/tapestry5/tapestry.js
> @@ -1020,21 +1020,32 @@ T5.extendInitializers({
>      updateZoneOnEvent : function(eventName, element, zoneId, url) {
>          element = $(element);
>  
> -        $T(element).zoneUpdater = true;
> -
> -        var zoneElement = zoneId == '^' ? $(element).up('.t-zone')
> -            : $(zoneId);
> -
> -        if (!zoneElement) {
> -            Tapestry
> -                .error(
> -                "Could not find zone element '#{zoneId}' to update on #{eventName} of
element '#{elementId}'.",
> -                {
> -                    zoneId : zoneId,
> -                    eventName : eventName,
> -                    elementId : element.id
> -                });
> -            return;
> +        var Telement = $T(element);
> +        Telement.zoneUpdater = true;
> +
> +        var destZoneId = zoneId;
> +        var zoneElement = null;
> +        if (zoneId == '^') {
> +        	zoneElement = element.up('.t-zone');
> +        	if (zoneElement)
> +        		destZoneId = zoneElement.id;
> +        }
> +        	
> +        if (Tapestry.DEBUG_ENABLED) {
> +        	if (!zoneElement && zoneId != '^')
> +        		zoneElement = $(zoneId);
> +
> +	        if (!zoneElement) {
> +	            Tapestry
> +	                .error(
> +	                "Could not find zone element '#{zoneId}' to update on #{eventName}
of element '#{elementId}'.",
> +	                {
> +	                    zoneId : zoneId,
> +	                    eventName : eventName,
> +	                    elementId : element.id
> +	                });
> +	            return;
> +	        }
>          }
>  
>          /*
> @@ -1042,7 +1053,7 @@ T5.extendInitializers({
>           * changed dynamically on the client side.
>           */
>  
> -        $T(element).zoneId = zoneElement.id;
> +        Telement.zoneId = zoneId;
>  
>          if (element.tagName == "FORM") {
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message