1 |
1 |
namespace('kivi.SalesPurchase', function(ns) {
|
2 |
2 |
this.edit_longdescription = function(row) {
|
3 |
|
var $edit = $('#popup_edit_longdescription_input');
|
4 |
3 |
var $element = $('#longdescription_' + row);
|
5 |
4 |
|
6 |
5 |
if (!$element.length) {
|
... | ... | |
8 |
7 |
return;
|
9 |
8 |
}
|
10 |
9 |
|
11 |
|
$edit.data('element', $element);
|
|
10 |
var $container = $('#popup_edit_longdescription_input_container');
|
|
11 |
var $edit = $('<textarea id="popup_edit_longdescription_input" class="texteditor-in-dialog" wrap="soft" style="width: 750px; height: 220px;"></textarea>');
|
|
12 |
|
|
13 |
$container.children().remove();
|
|
14 |
$container.append($edit);
|
|
15 |
$container.data('element', $element);
|
|
16 |
|
12 |
17 |
$edit.val($element.val());
|
13 |
18 |
|
|
19 |
kivi.init_text_editor($edit);
|
|
20 |
|
14 |
21 |
$('#popup_edit_longdescription_runningnumber').html(row);
|
15 |
22 |
$('#popup_edit_longdescription_partnumber').html($('#partnumber_' + row).val() || '');
|
16 |
23 |
|
... | ... | |
23 |
30 |
id: 'edit_longdescription_dialog',
|
24 |
31 |
dialog: {
|
25 |
32 |
title: kivi.t8('Enter longdescription'),
|
26 |
|
open: function() { kivi.set_focus('#popup_edit_longdescription_input'); }
|
|
33 |
open: function() { kivi.focus_ckeditor_when_ready('#popup_edit_longdescription_input'); },
|
|
34 |
close: function() { $('#popup_edit_longdescription_input_container').children().remove(); }
|
27 |
35 |
}
|
28 |
36 |
});
|
29 |
37 |
};
|
30 |
38 |
|
31 |
39 |
this.set_longdescription = function() {
|
32 |
|
var $edit = $('#popup_edit_longdescription_input');
|
33 |
|
var $element = $edit.data('element');
|
|
40 |
$('#popup_edit_longdescription_input_container')
|
|
41 |
.data('element')
|
|
42 |
.val( $('#popup_edit_longdescription_input').val() );
|
34 |
43 |
|
35 |
|
$element.val($edit.val());
|
36 |
44 |
$('#edit_longdescription_dialog').dialog('close');
|
37 |
45 |
};
|
38 |
46 |
|
Langtext-HTML-Editor: bei jedem Aufruf DOM-Element neu anlegen und ckeditor initialisieren
Unter Firefox kommt es beim mehrmaligen Aufrufen ansonsten sehr schnell
zu nicht mehr behebbaren JavaScript-Fehlern. Es bleibt dann beim Öffnen
des Popups nur das grau gestreifte Overlay sichtbar, nicht aber der
Dialog selber.