diff options
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/sort-table.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/assets/js/sort-table.js b/assets/js/sort-table.js index b0f0e62..26fbc49 100644 --- a/assets/js/sort-table.js +++ b/assets/js/sort-table.js @@ -9,6 +9,8 @@ * or http://opensource.org/licenses/MIT * * latest version available at https://github.com/tyleruebele/sort-table + * + * With changes Copyright (c) 2022 Ricardo Wurmus */ /** @@ -174,6 +176,18 @@ sortTable.raw = function(Cell) { }; /** + * Helper function that acts on a sortable data attribute of a table + * cell (TD). + * + * @param Cell A TD DOM object + * @returns {Number} + */ +sortTable.position = function(Cell) { + return Number(Cell.getAttribute('data-js-sort-position')); +}; + + +/** * Helper function that converts a table cell (TD) to a comparable value * Captures the last space-delimited token from innerHTML * |