Merge branch 'pr_2498' into dev

This commit is contained in:
Nick O'Leary
2020-05-22 15:22:12 +01:00
10 changed files with 396 additions and 98 deletions

View File

@@ -87,6 +87,9 @@
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
}
dialogForm.i18n();
setTimeout(function() {
expressionEditor.focus();
},300);
},
close: function() {
expressionEditor.destroy();

View File

@@ -68,6 +68,8 @@ RED.library = (function() {
var field = activeLibrary.fields[i];
if (field == "name") {
data.name = name;
} else if (typeof(field) === 'object') {
data[field.name] = field.get();
} else {
data[field] = $("#"+elementPrefix+field).val();
}
@@ -539,7 +541,13 @@ RED.library = (function() {
var elementPrefix = activeLibrary.elementPrefix || "node-input-";
for (var i=0; i<activeLibrary.fields.length; i++) {
var field = activeLibrary.fields[i];
$("#"+elementPrefix+field).val(selectedLibraryItem[field]);
if (typeof(field) === 'object') {
var val = selectedLibraryItem[field.name];
field.set(val);
}
else {
$("#"+elementPrefix+field).val(selectedLibraryItem[field]);
}
}
activeLibrary.editor.setValue(libraryEditor.getValue(),-1);
}