From 809b61dca1d87531716347611fcba33df23de6db Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Thu, 13 Oct 2016 16:24:37 -0400 Subject: [PATCH] Fix global table indexing fix #4741 Auditors: @bsclifton Test Plan: 1. go to about:history 2. sort the table 3. multi select entries 4. right click on them 5. perform any actions in context menu 6. the action tagets should be correct --- js/components/sortableTable.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/components/sortableTable.js b/js/components/sortableTable.js index f85d653fcf5..0c1a037ad26 100644 --- a/js/components/sortableTable.js +++ b/js/components/sortableTable.js @@ -83,10 +83,11 @@ class SortableTable extends ImmutableComponent { entry.className = entry.className.replace(' selected', '') const tableID = entry.id const index = entry.rowIndex - 1 + const globalIndex = parseInt(entry.title) const handlerInput = this.props.totalRowObjects - ? (typeof this.props.totalRowObjects[parseInt(tableID)][index].toJS === 'function' - ? this.props.totalRowObjects[parseInt(tableID)][index].toJS() - : this.props.totalRowObjects[parseInt(tableID)][index]) + ? (typeof this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS === 'function' + ? this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS() + : this.props.totalRowObjects[parseInt(tableID)][globalIndex]) : (this.props.rowObjects.size > 0 || this.props.rowObjects.length > 0) ? (typeof this.props.rowObjects.toJS === 'function' ? this.props.rowObjects.get(index).toJS() @@ -212,6 +213,7 @@ class SortableTable extends ImmutableComponent { ?