Better undefined CKEDITOR fix
This commit is contained in:
parent
bbfd138896
commit
ceb2920769
@ -515,8 +515,14 @@ jQuery(document).ready(function() {
|
|||||||
setforfree();
|
setforfree();
|
||||||
if (jQuery('#select_type').val() >= 0)
|
if (jQuery('#select_type').val() >= 0)
|
||||||
{
|
{
|
||||||
/* focus work on a standard textarea */
|
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
|
||||||
jQuery('#dp_desc').focus();
|
jQuery('#dp_desc').focus();
|
||||||
|
/* focus if CKEDITOR */
|
||||||
|
if (typeof(CKEDITOR) !== 'undefined')
|
||||||
|
{
|
||||||
|
var editor = CKEDITOR.instances['dp_desc'];
|
||||||
|
if (editor) { editor.focus(); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (jQuery('#select_type').val() == '0') jQuery('#trlinefordates').hide();
|
if (jQuery('#select_type').val() == '0') jQuery('#trlinefordates').hide();
|
||||||
else jQuery('#trlinefordates').show();
|
else jQuery('#trlinefordates').show();
|
||||||
@ -615,8 +621,14 @@ jQuery(document).ready(function() {
|
|||||||
/* To set focus */
|
/* To set focus */
|
||||||
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
|
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
|
||||||
{
|
{
|
||||||
/* focus work on a standard textarea */
|
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
|
||||||
jQuery('#dp_desc').focus();
|
jQuery('#dp_desc').focus();
|
||||||
|
/* focus if CKEDITOR */
|
||||||
|
if (typeof(CKEDITOR) !== 'undefined')
|
||||||
|
{
|
||||||
|
var editor = CKEDITOR.instances['dp_desc'];
|
||||||
|
if (editor) { editor.focus(); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user