From d9529bb1a2fa307b2886a7147d4789f95606133d Mon Sep 17 00:00:00 2001 From: Matus Brlit Date: Sat, 7 Feb 2015 21:35:30 +0100 Subject: [PATCH] fixed - mainsort larger than colspan fixed a possible issue, if the mainsort would be set outside of the colspan in this case, the last cell will be used --- Scripts/bootstrap-sortable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/bootstrap-sortable.js b/Scripts/bootstrap-sortable.js index c75df78..c849554 100644 --- a/Scripts/bootstrap-sortable.js +++ b/Scripts/bootstrap-sortable.js @@ -123,7 +123,7 @@ var colspan = $this.attr('colspan'); if (colspan) { - var mainSort = parseFloat($this.data('mainsort')) || 0; + var mainSort = Math.min(colspan - 1, parseFloat($this.data('mainsort')) || 0); var rowIndex = parseFloat($this.data('sortkey').split('-').pop()); // If there is one more row in header, delve deeper