Skip to content

Commit

Permalink
code clenup
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujith Isura authored and Yujith Isura committed Nov 18, 2019
1 parent 6ccb7c5 commit db3444a
Showing 1 changed file with 1 addition and 54 deletions.
55 changes: 1 addition & 54 deletions src/elections/ResultsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ export default class ResultsTable extends Component {
if (childLabel === this.props.activeLabel) {
className += ' tr-selected';
}

// const _tableRowList = results.map(
// function(result, i) {
// if (childLabel === 'Postal Votes') {
// postalVotes = totalElectors;
// }

return this.renderRow(
className,
Expand All @@ -288,53 +282,6 @@ export default class ResultsTable extends Component {
}.bind(this),
);


// var postalVotes = 0;
// results.map = (d) => {

// const childLabel = d.childLabelField;

// if (childLabel === 'Postal Votes') {
// postalVotes = d.electors;
// }
// return postalVotes;
// }


// results.forEach(function(d) {
// const childLabel = result[childLabelField];
// if (d.childLabel === "Postal Votes" ) {
// postalVotes = d.electors;
// }
// });


debugger;
// results.map = (result) => {
// const childLabel = result.childLabelField;
// if (childLabel === "Postal Votes" ) {
// postalVotes = result.electors;
// }else{
// postalVotes = "result.electors";
// }
// }

const postalVotes = results.map(
function(result, i) {
const childLabel = result[childLabelField];

let Electors = '';
if (result.pd_name === "Postal Votes") {
Electors = result.electors;
}

return Electors;

}.bind(this),
);



const _totalsRow = (this.props.showTotals) ?
this.renderRow(
'tr-totals',
Expand All @@ -349,7 +296,7 @@ debugger;
totalValid,
totalRejected,
totalPolled,
totalElectors + "ttfghfghss" + postalVotes,
totalElectors,
) : null;


Expand Down

0 comments on commit db3444a

Please sign in to comment.