// Event listener while clicking the tableviewrow. Every tableviewrow has its own controller.
$.getView().addEventListener('click', function() {
// test if the current row is selected. If so, deselect, if not, select.
if(this.backgroundColor === Alloy.Globals.palette.lightestBlue) {
// set as inactive/deselected for this controller. See function below.
exports.inactive();
// Filter module which keeps track of the state
parent.Filter._clickedAmount--;
} else {
// The following function checks if the row has the property 'singlepick', which requires it to be the only selected row (skipped in this particular bug)
exports.reflectSinglepick();
// active() comparable with inactive()
exports.active();
parent.Filter._clickedAmount++;
}
parent.Filter.update();
});
/**
* Set inactive.
*/
exports.inactive = function() {
// i tried a defer to fix the issue, but it didnt make a difference
_.defer(function() {
$.name.color = Alloy.Globals.palette.black;
$.getView().backgroundColor = Alloy.Globals.palette.white;
isActive = false;
});
};