Revision 08899a32
Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt
js/kivi.SalesPurchase.js | ||
---|---|---|
7 | 7 |
return; |
8 | 8 |
} |
9 | 9 |
|
10 |
var params = { element: $element, |
|
11 |
runningnumber: row, |
|
12 |
partnumber: $('#partnumber_' + row).val() || '', |
|
13 |
description: $('#description_' + row).val() || '', |
|
14 |
default_longdescription: $('#longdescription_' + row).val() || '' |
|
15 |
}; |
|
16 |
this.edit_longdescription_with_params(params); |
|
17 |
}; |
|
18 |
|
|
19 |
this.edit_longdescription_with_params = function(params) { |
|
10 | 20 |
var $container = $('#popup_edit_longdescription_input_container'); |
11 | 21 |
var $edit = $('<textarea id="popup_edit_longdescription_input" class="texteditor-in-dialog" wrap="soft" style="width: 750px; height: 220px;"></textarea>'); |
12 | 22 |
|
13 | 23 |
$container.children().remove(); |
14 | 24 |
$container.append($edit); |
15 |
$container.data('element', $element); |
|
16 | 25 |
|
17 |
$edit.val($element.val()); |
|
26 |
if (params.element) { |
|
27 |
$container.data('element', params.element); |
|
28 |
} |
|
29 |
|
|
30 |
$edit.val(params.default_longdescription); |
|
18 | 31 |
|
19 | 32 |
kivi.init_text_editor($edit); |
20 | 33 |
|
21 |
$('#popup_edit_longdescription_runningnumber').html(row);
|
|
22 |
$('#popup_edit_longdescription_partnumber').html($('#partnumber_' + row).val() || '');
|
|
34 |
$('#popup_edit_longdescription_runningnumber').html(params.runningnumber);
|
|
35 |
$('#popup_edit_longdescription_partnumber').html(params.partnumber);
|
|
23 | 36 |
|
24 |
var description = ($('#description_' + row).val() || '').replace(/[\n\r]+/, '');
|
|
37 |
var description = params.description.replace(/[\n\r]+/, '');
|
|
25 | 38 |
if (description.length >= 50) |
26 | 39 |
description = description.substring(0, 50) + "…"; |
27 | 40 |
$('#popup_edit_longdescription_description').html(description); |
Auch abrufbar als: Unified diff
kivi.SalesPurchase.edit_longdescription: Aufruf auch mit einzelnen Parametern …
ermöglichen, statt mit row. Dafür gibt es eine zweite Funktion "..._with_params.
Diese wird jetzt von kivi.SalesPurchase.edit_longdescription(row) aufgerufen,
damit in den vorhandenen Templates nicht angepasst werden muss.