From 1360b1592d0ac833979202aa1ef8f05cc4791b70 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 24 Aug 2021 22:04:43 +1000 Subject: [PATCH] Some convenience functions --- InvenTree/templates/js/translated/tables.js | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/InvenTree/templates/js/translated/tables.js b/InvenTree/templates/js/translated/tables.js index 88d9a5f99a..b9a05689d0 100644 --- a/InvenTree/templates/js/translated/tables.js +++ b/InvenTree/templates/js/translated/tables.js @@ -1,6 +1,29 @@ {% load i18n %} +function tdWrap(html, options={}) { + /* Wraps provided html in .. elements + */ + + var colspan = ''; + + if (options.colspan) { + colspan = ` colspan=${options.colspan}`; + } + + return `${html}`; +} + + +function trWrap(html) { + /* Wraps provided html in .. elements + */ + + return `${html}`; +} + + + function reloadtable(table) { $(table).bootstrapTable('refresh'); }