Skip to content
Snippets Groups Projects
Commit efa471b1 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: test if ckeditor is enabled

parent 7fa4b9b4
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment