$(document).ready(function() {
$('#talents li').on('click', 'div', function(event) {
event.stopPropagation();
$(event.target).addClass('--active');
talents_points = $('.--active').length;
_this.setState({ points: talents_points });
this.handlePointsMaxed(talents_points);
});
$('.no-right-click').bind('contextmenu', function(event) {
event.stopPropagation();
$(event.target).removeClass('--active');
talents_points = $('.--active').length;
_this.setState({ points: talents_points });
// this.handlePointsMaxed(talents_points);
return false;
});
});
<ul id="talents">
<li onClick={this.handlePointsClicks}>
<div id="talent-stacks" className="talent-image__stacks"></div>
</li>
</ul>`
Any idea why? I'm positive it's on the mousedown and click functions but I need them both for what I making and have not found another way to combine these.
EDIT: Added the HTML sample for context