From c797073c05731a81adff36a6681f4e9ea8c89af3 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 30 Sep 2016 23:35:05 +0100 Subject: [PATCH] Ignore bidi event handling on non-existent and non-Input elements Closes #999 --- editor/js/ui/editor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/editor/js/ui/editor.js b/editor/js/ui/editor.js index a055dc69d..b9bbb4d51 100644 --- a/editor/js/ui/editor.js +++ b/editor/js/ui/editor.js @@ -303,6 +303,9 @@ RED.editor = (function() { */ function preparePropertyEditor(node,property,prefix,definition) { var input = $("#"+prefix+"-"+property); + if (input.length === 0) { + return; + } if (input.attr('type') === "checkbox") { input.prop('checked',node[property]); } @@ -316,7 +319,9 @@ RED.editor = (function() { RED.text.format.attach(input[0], definition[property].format, {}, false, "en"); } else { input.val(val); - RED.text.bidi.prepareInput(input); + if (input[0].nodeName === 'INPUT' || input[0].nodeName === 'TEXTAREA') { + RED.text.bidi.prepareInput(input); + } } } } @@ -1179,7 +1184,7 @@ RED.editor = (function() { } configNodes.forEach(function(cn) { - select.append(''); + select.append(''); delete cn.__label__; });