Skip to content

Commit

Permalink
[Fix #2]
Browse files Browse the repository at this point in the history
- Correção na exibição do preview da imagem;
- Atualização do nome do package;
- Reposicionamento do ícone do nó;
  • Loading branch information
DiegoRampim committed Jan 5, 2018
1 parent 2877333 commit 5ce2db7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions nodes/ui_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
inputs: 1,
icon: "ui_image.png",
paletteLabel: 'image',
align: 'right',
label: function () {
return this.name || 'image';
},
Expand Down Expand Up @@ -121,7 +122,17 @@
$("#node-input-file").change(function () {
var value = $('#node-input-file').val();

if (value != null) {
if (value == "select") {

that.path = undefined;

$("#node-input-link").val("");
$("#image-preview").hide();

return;
}

if (value != null && value != undefined) {
var url = '/uiimage/' + value;
$("#node-input-link").val(value);
$("#image-preview").attr('src', url).show();
Expand All @@ -130,6 +141,9 @@
path: url,
ref: value
};
} else {
$("#node-input-link").val("");
$("#image-preview").hide();
}
});

Expand Down Expand Up @@ -333,7 +347,7 @@

<div style="position: absolute; left: 0px; right: 50px;">
<select style="width:100%" id="node-input-file">
<option></option>
<option value="select">Select image...</option>
</select>
</div>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-red-dashboard-image",
"name": "node-red-dashboard",
"version": "2.7.0-beta",
"description": "A set of dashboard nodes for Node-RED",
"keywords": [
Expand Down

0 comments on commit 5ce2db7

Please sign in to comment.