From 258555a8137973953fb2e0ab5fd9d8be33c9b040 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 15 Apr 2019 00:11:26 +1000 Subject: [PATCH] Add placeholder text option for field editing --- InvenTree/static/script/tables.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/InvenTree/static/script/tables.js b/InvenTree/static/script/tables.js index 512c49442b..0d3f129273 100644 --- a/InvenTree/static/script/tables.js +++ b/InvenTree/static/script/tables.js @@ -21,7 +21,8 @@ function renderEditable(text, options) { * Can pass the following parameters in 'options': * _type - parameter for data-type (default = 'text') * _pk - parameter for data-pk (required) - * _title - + * _title - title to show when editing + * _empty - placeholder text to show when field is empty * _class - html class (default = 'editable-item') * _id - id */ @@ -44,6 +45,11 @@ function renderEditable(text, options) { html = html + " data-title='" + options._title + "'"; } + if (options._empty) { + html = html + " data-placeholder='" + options._empty + "'"; + html = html + " data-emptytext='" + options._empty + "'"; + } + html = html + ">" + text + ""; return html;