From: garvinhicking Date: Mon, 29 Aug 2005 14:16:00 +0000 (+0000) Subject: Check for existance of the function first X-Git-Tag: 0.9~176 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=58196e7e69318fdcf447946d8a26d98b0f3bde0f;p=s9y.git Check for existance of the function first --- diff --git a/deployment/serendipity_editor.js b/deployment/serendipity_editor.js index d7dc031..782d9b2 100644 --- a/deployment/serendipity_editor.js +++ b/deployment/serendipity_editor.js @@ -139,6 +139,9 @@ function serendipity_imageSelector_addToElement (str, el) { document.getElementById(el).value = str; document.getElementById(el).focus(); + if (document.getElementById(el).onchange) { + document.getElementById(el).onchange(); + } } function serendipity_imageSelector_addToBody (str, textarea) diff --git a/serendipity_editor.js b/serendipity_editor.js index c4ca8e6..6e0484e 100644 --- a/serendipity_editor.js +++ b/serendipity_editor.js @@ -139,7 +139,9 @@ function serendipity_imageSelector_addToElement (str, el) { document.getElementById(el).value = str; document.getElementById(el).focus(); - document.getElementById(el).onchange(); + if (document.getElementById(el).onchange) { + document.getElementById(el).onchange(); + } } function serendipity_imageSelector_addToBody (str, textarea)