mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 12:36:45 +00:00
Removed unused function
This commit is contained in:
parent
b192deb465
commit
1b32f9d650
@ -2,10 +2,12 @@ function editButton(url, text='Edit') {
|
|||||||
return "<button class='btn btn-success edit-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
return "<button class='btn btn-success edit-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function deleteButton(url, text='Delete') {
|
function deleteButton(url, text='Delete') {
|
||||||
return "<button class='btn btn-danger delete-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
return "<button class='btn btn-danger delete-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function renderLink(text, url) {
|
function renderLink(text, url) {
|
||||||
if (text === '' || url === '') {
|
if (text === '' || url === '') {
|
||||||
return text;
|
return text;
|
||||||
@ -14,51 +16,6 @@ function renderLink(text, url) {
|
|||||||
return '<a href="' + url + '">' + text + '</a>';
|
return '<a href="' + url + '">' + text + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderEditable(text, options) {
|
|
||||||
/* Wrap the text in an 'editable' link
|
|
||||||
* (using bootstrap-editable library)
|
|
||||||
*
|
|
||||||
* Can pass the following parameters in 'options':
|
|
||||||
* _type - parameter for data-type (default = 'text')
|
|
||||||
* _pk - parameter for data-pk (required)
|
|
||||||
* _title - title to show when editing
|
|
||||||
* _empty - placeholder text to show when field is empty
|
|
||||||
* _class - html class (default = 'editable-item')
|
|
||||||
* _id - id
|
|
||||||
* _value - Initial value of the editable (default = blank)
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Default values (if not supplied)
|
|
||||||
var _type = options._type || 'text';
|
|
||||||
var _class = options._class || 'editable-item';
|
|
||||||
|
|
||||||
var html = "<a href='#' class='" + _class + "'";
|
|
||||||
|
|
||||||
// Add id parameter if provided
|
|
||||||
if (options._id) {
|
|
||||||
html = html + " id='" + options._id + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
html = html + " data-type='" + _type + "'";
|
|
||||||
html = html + " data-pk='" + options._pk + "'";
|
|
||||||
|
|
||||||
if (options._title) {
|
|
||||||
html = html + " data-title='" + options._title + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options._value) {
|
|
||||||
html = html + " data-value='" + options._value + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options._empty) {
|
|
||||||
html = html + " data-placeholder='" + options._empty + "'";
|
|
||||||
html = html + " data-emptytext='" + options._empty + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
html = html + ">" + text + "</a>";
|
|
||||||
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
function enableButtons(elements, enabled) {
|
function enableButtons(elements, enabled) {
|
||||||
for (let item of elements) {
|
for (let item of elements) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user