mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Avoid innerHtml
This commit is contained in:
parent
ae7a3981c0
commit
0fef2ab509
@ -94,18 +94,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttons.forEach(function(button) {
|
buttons.forEach(function(button) {
|
||||||
var innerHtml = "";
|
var text = "";
|
||||||
var titleAttribute="";
|
var titleAttribute="";
|
||||||
if (button.icon) {
|
if (button.icon) {
|
||||||
innerHtml = '<i class="'+button.icon+'"></i> ';
|
text = '<i class="'+button.icon+'"></i> ';
|
||||||
}
|
}
|
||||||
if (button.label) {
|
if (button.label) {
|
||||||
innerHtml += button.label;
|
text += button.label;
|
||||||
}
|
}
|
||||||
if (button.title) {
|
if (button.title) {
|
||||||
titleAttribute = 'title="'+button.title+'"';
|
titleAttribute = 'title="'+button.title+'"';
|
||||||
}
|
}
|
||||||
$('<a href="#" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;" '+titleAttribute+'>'+innerHtml+'</a>')
|
$('<a href="#" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;" '+titleAttribute+'></a>')
|
||||||
|
.text(text)
|
||||||
.appendTo(that.topContainer)
|
.appendTo(that.topContainer)
|
||||||
.on("click", function(evt) {
|
.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user