From e856322df0411eef7e893ec8d2aebc49d49b6343 Mon Sep 17 00:00:00 2001 From: Mack Hankins Date: Fri, 12 Aug 2016 09:08:30 -0500 Subject: [PATCH 1/3] IV Sort Fix This should fix #67. --- js/screens/Table/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/screens/Table/index.jsx b/js/screens/Table/index.jsx index 9673283..8f96ea5 100644 --- a/js/screens/Table/index.jsx +++ b/js/screens/Table/index.jsx @@ -68,7 +68,7 @@ function format (d) { html += '' + poke.td_name + '' html += '' + poke.td_nickname + '' html += '' + poke.td_cp + '' - html += '' + poke.td_pokeiv + '' + html += '' + poke.td_pokeiv + '' html += '' } html += '' From 450a2d8d27052029764aba27e4fcc65b7a7f6260 Mon Sep 17 00:00:00 2001 From: Mack Hankins Date: Fri, 12 Aug 2016 11:21:06 -0500 Subject: [PATCH 2/3] Remove Transfer / Evolve changes if favorite This is a fix for #48 and #58 --- js/screens/Table/index.jsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/js/screens/Table/index.jsx b/js/screens/Table/index.jsx index 8f96ea5..85d01f2 100644 --- a/js/screens/Table/index.jsx +++ b/js/screens/Table/index.jsx @@ -89,7 +89,11 @@ function prepDisplay (d) { var pokeiv = poke['iv'] + '% (' + poke['attack'] + '/' + poke['defense'] + '/' + poke['stamina'] + ')' var favoriteBool = poke['favorite'] ? 'true' : 'false' - if (poke.deployed) checkBox += ' disabled' + if (poke.deployed || poke.favorite) { + checkBox += ' disabled' + } else { + checkBox += ' enabled' + } if (poke.favorite) favorite = 'glyphicon glyphicon-star favorite-yellow' poke.td_checkbox = checkBox + '>' @@ -361,6 +365,7 @@ const Table = React.createClass({ if (row.child.isShown()) { // This row is already open - close it + $('#' + row.data().pokemon_id).DataTable().destroy() row.child.hide() tr.removeClass('shown') } else { @@ -384,6 +389,15 @@ const Table = React.createClass({ // Check all boxes $('#' + d.pokemon_id + ' #checkall').click(function () { $(':checkbox', table.rows().nodes()).prop('checked', this.checked) + $(':checkbox', table.rows().nodes()).filter(':disabled').attr('disabled', true) + }) + + $('#' + d.pokemon_id + ' td span.favorite').click(function () { + if ($(this).hasClass('favorite-yellow')) { + $(this).closest('tr').find(':checkbox').attr('disabled', false) + } else { + $(this).closest('tr').find(':checkbox').attr('disabled', true) + } }) document.querySelectorAll('td a.nickname').forEach(el => { From 21a35c23ac83df748ed9b1fac980267e3fe21a29 Mon Sep 17 00:00:00 2001 From: Mack Hankins Date: Fri, 12 Aug 2016 11:43:08 -0500 Subject: [PATCH 3/3] cleanup Not sure why --- js/screens/Table/index.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/screens/Table/index.jsx b/js/screens/Table/index.jsx index 85d01f2..86f1042 100644 --- a/js/screens/Table/index.jsx +++ b/js/screens/Table/index.jsx @@ -89,11 +89,7 @@ function prepDisplay (d) { var pokeiv = poke['iv'] + '% (' + poke['attack'] + '/' + poke['defense'] + '/' + poke['stamina'] + ')' var favoriteBool = poke['favorite'] ? 'true' : 'false' - if (poke.deployed || poke.favorite) { - checkBox += ' disabled' - } else { - checkBox += ' enabled' - } + if (poke.deployed || poke.favorite) checkBox += ' disabled' if (poke.favorite) favorite = 'glyphicon glyphicon-star favorite-yellow' poke.td_checkbox = checkBox + '>'