GamerPolls / gamerpolls.com

A polling site geared towards use by streamers on Twitch.
http://gamerpolls.com/
GNU General Public License v3.0
5 stars 2 forks source link

Sort answers based on number of votes #37

Closed cletusc closed 10 years ago

cletusc commented 10 years ago

This would apply only to the poll#showResults page as poll#showVersus would be odd to sort.

cletusc commented 10 years ago

Client-side sorting needs to be converted to number. Order seen: 73, 28, 108 should be 108, 73, 28...

@ view poll#showResults, L222-L223

a = $(a).find('span[data-bind*="votes.normal"]').text();
b = $(b).find('span[data-bind*="votes.normal"]').text();

should be

a = Number($(a).find('span[data-bind*="votes.normal"]').text());
b = Number($(b).find('span[data-bind*="votes.normal"]').text());