More consistent check

This commit is contained in:
Ion Agorria 2015-12-11 03:09:09 +01:00
parent ceb2920769
commit f34fb0d82d

View File

@ -518,7 +518,7 @@ jQuery(document).ready(function() {
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus();
/* focus if CKEDITOR */
if (typeof(CKEDITOR) !== 'undefined')
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined")
{
var editor = CKEDITOR.instances['dp_desc'];
if (editor) { editor.focus(); }
@ -624,7 +624,7 @@ jQuery(document).ready(function() {
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus();
/* focus if CKEDITOR */
if (typeof(CKEDITOR) !== 'undefined')
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined")
{
var editor = CKEDITOR.instances['dp_desc'];
if (editor) { editor.focus(); }