mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add placeholder text option for field editing
This commit is contained in:
parent
264f189917
commit
258555a813
@ -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 + "</a>";
|
||||
|
||||
return html;
|
||||
|
Loading…
Reference in New Issue
Block a user