mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add a button to restore user defined icon (#1569)
This commit is contained in:
parent
87d847a074
commit
da4a0f09ed
@ -776,6 +776,16 @@ RED.editor = (function() {
|
|||||||
var fileName = selectIconFile.val();
|
var fileName = selectIconFile.val();
|
||||||
iconFileHidden.val(fileName);
|
iconFileHidden.val(fileName);
|
||||||
});
|
});
|
||||||
|
var clear = $('<button class="editor-button editor-button-small"><i class="fa fa-times"></i></button>').appendTo(iconForm);
|
||||||
|
clear.click(function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
var iconPath = RED.utils.getDefaultNodeIcon(node._def, node);
|
||||||
|
selectIconModule.val(iconPath.module);
|
||||||
|
moduleChange(selectIconModule, selectIconFile, iconModuleHidden, iconFileHidden, iconSets, true);
|
||||||
|
selectIconFile.removeClass("input-error");
|
||||||
|
selectIconFile.val(iconPath.file);
|
||||||
|
iconFileHidden.val(iconPath.file);
|
||||||
|
});
|
||||||
|
|
||||||
moduleChange(selectIconModule, selectIconFile, iconModuleHidden, iconFileHidden, iconSets, false);
|
moduleChange(selectIconModule, selectIconFile, iconModuleHidden, iconFileHidden, iconSets, false);
|
||||||
var iconFileList = iconSets[selectIconModule.val()];
|
var iconFileList = iconSets[selectIconModule.val()];
|
||||||
|
Loading…
Reference in New Issue
Block a user