1 namespace('kivi.SalesPurchase', function(ns) {
2 this.edit_longdescription = function(row) {
3 var $edit = $('#popup_edit_longdescription_input');
4 var $element = $('#longdescription_' + row);
6 if (!$element.length) {
7 console.error("kivi.SalesPurchase.edit_longdescription: Element #longdescription_" + row + " not found");
11 $edit.data('element', $element);
12 $edit.val($element.val());
14 $('#popup_edit_longdescription_runningnumber').html(row);
15 $('#popup_edit_longdescription_partnumber').html($('#partnumber_' + row).val() || '');
17 var description = ($('#description_' + row).val() || '').replace(/[\n\r]+/, '');
18 if (description.length >= 50)
19 description = description.substring(0, 50) + "…";
20 $('#popup_edit_longdescription_description').html(description);
23 id: 'edit_longdescription_dialog',
25 title: kivi.t8('Enter longdescription')
30 this.set_longdescription = function() {
31 var $edit = $('#popup_edit_longdescription_input');
32 var $element = $edit.data('element');
34 $element.val($edit.val());
35 $('#edit_longdescription_dialog').dialog('close');