Fix: test if ckeditor is enabled

This commit is contained in:
Regis Houssin
2012-08-26 21:47:56 +02:00
parent 7fa4b9b423
commit efa471b12b
2 changed files with 4 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}
if (ui.item.textarea) {
$.each(ui.item.textarea, function(key, value) {
if (CKEDITOR) {
if (typeof CKEDITOR == "object") {
CKEDITOR.instances[key].setData(value);
CKEDITOR.instances[key].focus();
} else {

View File

@@ -220,7 +220,7 @@ $(document).ready(function() {
$('#idprod').change(function() {
if ($(this).val().length > 0)
{
if (CKEDITOR) {
if (typeof CKEDITOR == 'object') {
CKEDITOR.instances['product_desc'].focus();
} else {
$('#product_desc').focus();
@@ -336,7 +336,7 @@ $(document).ready(function() {
var origin_desc = $('#origin_desc_cache').val();
if (CKEDITOR) {
if (typeof CKEDITOR == 'object') {
var freecontent = CKEDITOR.instances['product_desc'].getData();
if (origin_desc.length > 0)
var content = origin_desc + '<br />' + freecontent;
@@ -356,7 +356,7 @@ $(document).ready(function() {
var content = $('#free_desc_cache').val();
}
if (CKEDITOR) {
if (typeof CKEDITOR == 'object') {
CKEDITOR.instances['product_desc'].setData(content);
} else {
$('#product_desc').html(content);