-
-
Save ashaw/604663 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TableFilterer.prototype.addClickHandler = function(el,facet,featuredness) { | |
tFinstance = this; | |
$(el).live('click',function() { | |
var entity = $(this).attr("data-"+facet); | |
var type = $(this).children('h4').html(); | |
//for race "permalinks" | |
if (!_.isNaN(parseInt(entity))) { | |
entity = parseInt(entity); | |
}; | |
$("#toolbar span").each(function() { | |
$(this).removeClass("selected"); | |
}); | |
$("#toolbar span[data-office_id=" + entity + "]").addClass("selected") | |
tFinstance.filterTableByall(); | |
if (congro.unmagnified === false) { | |
console.log('magnified'); | |
var current_magnified_state = congro.mag_state["0"].state_abbrev; | |
console.log(entity); | |
filterer.filterTableByMulti({'state_postal' : current_magnified_state, 'office_id' : entity}); | |
} else { | |
tFinstance['filterTableBy' + facet](entity); | |
} | |
tFinstance.populateTable(); | |
congro.colorStates(type); | |
congro.loadResults(type); | |
return false; | |
}); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment