[OpenLayers-Dev] Patch to Panel.js

Eric Lemoine eric.lemoine at camptocamp.com
Fri Oct 15 15:29:58 EDT 2010


On Fri, Oct 15, 2010 at 8:59 PM, Matthew Michels <mattm at tuscanyda.com> wrote:
> I haven't gotten around to subscribing to the Trac system yet for OpenLayers.
> Will try to do that soon.
>
> We found what appears to be a bug in Panel.js, namely that 'children' appears
> to not exist on older (3.0 and earlier) versions of Firefox.  I believe that
> 'childNodes' is the correct W3C member.
>
>
> We made this change to fix the problem:
>
> --- OpenLayers-2.10/lib/OpenLayers/Control/Panel.js     2010-10-12 00:18:35 UTC (rev 15870)
> +++ OpenLayers-2.10/lib/OpenLayers/Control/Panel.js     2010-10-12 01:53:25 UTC (rev 15871)
> @@ -165,9 +165,9 @@
>      * Method: redraw
>      */
>     redraw: function() {
> -        if (this.div.children.length>0) {
> -            for (var l=this.div.children.length, i=l-1 ; i>=0 ; i--) {
> -                this.div.removeChild(this.div.children[i]);
> +        if (this.div.childNodes.length>0) {
> +            for (var l=this.div.childNodes.length, i=l-1 ; i>=0 ; i--) {
> +                this.div.removeChild(this.div.childNodes[i]);
>             }
>         }
>         this.div.innerHTML = "";
>
> We wanted to report this in case this could be of help to others.

This is fixed in trunk already. See
<http://trac.osgeo.org/openlayers/changeset/10801/>.



-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Dev mailing list