2
0
forked from Wavyzz/dolibarr

Fix: add test for instance

This commit is contained in:
Regis Houssin
2012-08-27 14:08:59 +02:00
parent fb866d9106
commit 6426ef3f8d
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 (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].focus();
} else {

View File

@@ -219,7 +219,7 @@ $(document).ready(function() {
$('#idprod').change(function() {
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
CKEDITOR.instances['product_desc'].focus();
} else {
@@ -338,7 +338,7 @@ $(document).ready(function() {
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
var freecontent = CKEDITOR.instances['product_desc'].getData();
if (origin_desc.length > 0)
@@ -360,7 +360,7 @@ $(document).ready(function() {
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
CKEDITOR.instances['product_desc'].setData(content);
} else {