mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Fix: test if ckeditor is enabled
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user