Skip to content

Commit

Permalink
Convert state abbreviations to uppercase.
Browse files Browse the repository at this point in the history
[Resolves fecgov#846]
  • Loading branch information
jmcarp committed Oct 16, 2015
1 parent afb2f39 commit a493228
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions static/js/modules/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ DistrictMap.prototype.load = function(election) {
var encoded = utils.encodeDistrict(election.state, election.district);
feature = utils.findDistrict(encoded);
} else if (election.state) {
var state = fips.fipsByState[election.state].STATE;
feature = stateFeatureMap[state];
var state = fips.fipsByState[election.state.toUpperCase()];
if (state) {
feature = stateFeatureMap[state.STATE];
}
}
feature && this.render(feature);
};
Expand Down
4 changes: 2 additions & 2 deletions static/js/pages/elections.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* global require, module, window, document, context */
/* global document, context */

var d3 = require('d3');
var $ = require('jquery');
Expand Down Expand Up @@ -267,7 +267,7 @@ function drawStateMap($container, candidateId, cached) {
var results = _.reduce(
data.results,
function(acc, val) {
var row = fips.fipsByState[val.state] || {};
var row = fips.fipsByState[val.state.toUpperCase()] || {};
var code = row.STATE ? parseInt(row.STATE) : null;
acc[code] = val.total;
return acc;
Expand Down

0 comments on commit a493228

Please sign in to comment.