Skip to content

Commit

Permalink
Merge pull request #5067 from pjackson28/fixie8buggeomap
Browse files Browse the repository at this point in the history
Geomap: Fixed issue in IE8 with thead manipulation (fixes #4998)
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Mar 31, 2014
2 parents 7e58a0d + ebc7547 commit baf9177
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/plugins/deps/geomap-lib.js
Expand Up @@ -798,20 +798,19 @@ var pluginName = "wb-geomap",
feature: evt.features[ 0 ]
},
targetTable = document.getElementById( $table.attr( "id" ) ),
targetTableHead = targetTable.getElementsByTagName( "thead" )[ 0 ],
targetTableBody = targetTable.getElementsByTagName( "tbody" )[ 0 ],
selectControl = geomap.selectControl,
features = evt.features,
len = features.length,
geoRegex = /\W/g,
headRow = createRow( geomap, rowObj, zoom, mapControl ),
tableBody = targetTableBody.innerHTML,
feature, i;

targetTable
.getElementsByTagName( "thead" )[ 0 ]
.innerHTML = createRow( geomap, rowObj, zoom, mapControl );

for ( i = 0; i !== len; i += 1 ) {
feature = features[ i ];
targetTableBody.innerHTML += createRow(
tableBody += createRow(
geomap,
{
type: "body",
Expand All @@ -823,6 +822,15 @@ var pluginName = "wb-geomap",
mapControl
);
}

// Temporary fix for unknown runtime error in IE8
if ( wb.ielt9 ) {
$( targetTableHead ).html( headRow );
$( targetTableBody ).html( tableBody );
} else {
targetTableHead.innerHTML = headRow;
targetTableBody.innerHTML += tableBody;
}
},

/*
Expand Down Expand Up @@ -852,11 +860,17 @@ var pluginName = "wb-geomap",

// Find the row
var featureId = feature.id.replace( /\W/g, "_" ),
tr = document.getElementById( featureId );
tr = document.getElementById( featureId ),
newTr = addChkBox( geomap, feature, featureId ) + tr.innerHTML +
( mapControl && zoom ? addZoomTo( geomap, feature ) : "" );

// Add select checkbox and zoom column
tr.innerHTML = addChkBox( geomap, feature, featureId ) + tr.innerHTML +
( mapControl && zoom ? addZoomTo( geomap, feature ) : "" );
// Temporary fix for IE8 unknown runtime error bug
if ( wb.ielt9 ) {
$( tr ).html( newTr );
} else {
tr.innerHTML = newTr;
}
},

/*
Expand Down

0 comments on commit baf9177

Please sign in to comment.