1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ignore bidi event handling on non-existent and non-Input elements

Closes #999
This commit is contained in:
Nick O'Leary 2016-09-30 23:35:05 +01:00
parent d9d65d59d1
commit c797073c05

View File

@ -303,6 +303,9 @@ RED.editor = (function() {
*/ */
function preparePropertyEditor(node,property,prefix,definition) { function preparePropertyEditor(node,property,prefix,definition) {
var input = $("#"+prefix+"-"+property); var input = $("#"+prefix+"-"+property);
if (input.length === 0) {
return;
}
if (input.attr('type') === "checkbox") { if (input.attr('type') === "checkbox") {
input.prop('checked',node[property]); input.prop('checked',node[property]);
} }
@ -316,10 +319,12 @@ RED.editor = (function() {
RED.text.format.attach(input[0], definition[property].format, {}, false, "en"); RED.text.format.attach(input[0], definition[property].format, {}, false, "en");
} else { } else {
input.val(val); input.val(val);
if (input[0].nodeName === 'INPUT' || input[0].nodeName === 'TEXTAREA') {
RED.text.bidi.prepareInput(input); RED.text.bidi.prepareInput(input);
} }
} }
} }
}
/** /**
* Add an on-change handler to revalidate a node field * Add an on-change handler to revalidate a node field
@ -1179,7 +1184,7 @@ RED.editor = (function() {
} }
configNodes.forEach(function(cn) { configNodes.forEach(function(cn) {
select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+cn.__label__+'</option>'); select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+RED.text.bidi.enforceTextDirectionWithUCC(cn.__label__)+'</option>');
delete cn.__label__; delete cn.__label__;
}); });