Changeset 5724 for cowsclient


Ignore:
Timestamp:
17/09/09 15:02:41 (10 years ago)
Author:
pnorton
Message:

Added a doctype to the wmsviz template which means that IE will now render in standards mode. This fixed some rendering problems with the openlayers map.

Also fixed a bug in the layerDimensions code that caused the download button to fail.

Location:
cowsclient/trunk/cowsclient
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/public/js/layerDimensions.js

    r5720 r5724  
    115115        var dims = {}; 
    116116         
    117         for (var i = 0; i < this._form.elements.length; i++) { 
    118                 var element = this._form.elements[i]; 
     117        var elements = Utils.getActiveFormElements(this._form); 
     118         
     119        for (var i = 0; i < elements.length; i++) { 
     120                var element = elements[i]; 
    119121                 
    120122                if (element.name !== null) { 
  • cowsclient/trunk/cowsclient/public/js/utils.js

    r5720 r5724  
    108108    var handlerLookup = {}; 
    109109     
     110    // only attach events to the active elements, this avoids the fieldset element 
     111    // which could cause handlers to be called twice, or not be called at all 
     112    // in IE. 
     113    var activeElements = Utils.getActiveFormElements(form); 
     114     
     115    for (var i = 0; i < activeElements.length; i++) { 
     116        var element = activeElements[i]; 
     117 
     118        handlerLookup[element.id] = Utils.addHTMLEventListener(element,  
     119                                           eventName, handlerFunction, scope); 
     120    } 
     121     
     122    return handlerLookup; 
     123}; 
     124 
     125Utils.getActiveFormElements = function (form) { 
     126    var elementList = []; 
     127    var elementTypes = ['INPUT','SELECT','TEXTAREA', 'BUTTON']; 
     128     
    110129    for (var i = 0; i < form.elements.length; i++) { 
    111130        var element = form.elements[i]; 
    112  
    113         handlerLookup[element.id] = Utils.addHTMLEventListener(element, eventName,  
    114                                                          handlerFunction, scope); 
    115     } 
    116      
    117     return handlerLookup; 
    118 }; 
     131         
     132        if (Utils.isValueInList(element.tagName.toUpperCase(), elementTypes)) { 
     133            elementList.push(element); 
     134        } 
     135    } 
     136     
     137    return elementList; 
     138}; 
     139 
    119140 
    120141Utils.removeEventHandlersFromLookup = function (lookup, eventType) { 
  • cowsclient/trunk/cowsclient/public/layout/open_layers_map.css

    r5719 r5724  
    55  height: 320px; 
    66  background-color: white; 
    7   margin: 1px; 
     7  margin: 0px; 
    88  border: 1px solid #222277; 
     9   
    910} 
    1011 
     
    1213  margin-bottom: 0em; 
    1314} 
     15 
    1416 
    1517.olControlLoadingPanel { 
  • cowsclient/trunk/cowsclient/templates/wmsviz.html

    r5719 r5724  
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
     2 
    13<html xmlns:py="http://genshi.edgewall.org/"  
    24      xmlns="http://www.w3.org/1999/xhtml" 
     
    133135function init() { 
    134136 
    135         var initialSetupJSON = "${c.initialSetupJSON}"; 
     137    var initialSetupJSON = "${c.initialSetupJSON}"; 
    136138        var baseLayerJSON = "${c.baseLayerJSON}"; 
    137139 
Note: See TracChangeset for help on using the changeset viewer.