forked from Wavyzz/dolibarr
Fix: add test for instance
This commit is contained in:
@@ -136,7 +136,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
}
|
}
|
||||||
if (ui.item.textarea) {
|
if (ui.item.textarea) {
|
||||||
$.each(ui.item.textarea, function(key, value) {
|
$.each(ui.item.textarea, function(key, value) {
|
||||||
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") {
|
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances["product_desc"] != "undefined") {
|
||||||
CKEDITOR.instances[key].setData(value);
|
CKEDITOR.instances[key].setData(value);
|
||||||
CKEDITOR.instances[key].focus();
|
CKEDITOR.instances[key].focus();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$('#idprod').change(function() {
|
$('#idprod').change(function() {
|
||||||
if ($(this).val().length > 0) {
|
if ($(this).val().length > 0) {
|
||||||
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined') {
|
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined' && CKEDITOR.instances['product_desc'] != 'undefined') {
|
||||||
// We use CKEditor
|
// We use CKEditor
|
||||||
CKEDITOR.instances['product_desc'].focus();
|
CKEDITOR.instances['product_desc'].focus();
|
||||||
} else {
|
} else {
|
||||||
@@ -338,7 +338,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
var origin_desc = $('#origin_desc_cache').val();
|
var origin_desc = $('#origin_desc_cache').val();
|
||||||
|
|
||||||
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined') {
|
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined' && CKEDITOR.instances['product_desc'] != 'undefined') {
|
||||||
// We use CKEditor
|
// We use CKEditor
|
||||||
var freecontent = CKEDITOR.instances['product_desc'].getData();
|
var freecontent = CKEDITOR.instances['product_desc'].getData();
|
||||||
if (origin_desc.length > 0)
|
if (origin_desc.length > 0)
|
||||||
@@ -360,7 +360,7 @@ $(document).ready(function() {
|
|||||||
var content = $('#free_desc_cache').val();
|
var content = $('#free_desc_cache').val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined') {
|
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined' && CKEDITOR.instances['product_desc'] != 'undefined') {
|
||||||
// We use CKEditor
|
// We use CKEditor
|
||||||
CKEDITOR.instances['product_desc'].setData(content);
|
CKEDITOR.instances['product_desc'].setData(content);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user