kivitendo/js/kivi.SalesPurchase.js @ 766f5705
ff058663 | Moritz Bunkus | namespace('kivi.SalesPurchase', function(ns) {
|
||
this.edit_longdescription = function(row) {
|
||||
var $edit = $('#popup_edit_longdescription_input');
|
||||
var $element = $('#longdescription_' + row);
|
||||
if (!$element.length) {
|
||||
console.error("kivi.SalesPurchase.edit_longdescription: Element #longdescription_" + row + " not found");
|
||||
return;
|
||||
}
|
||||
$edit.data('element', $element);
|
||||
$edit.val($element.val());
|
||||
$('#popup_edit_longdescription_runningnumber').html(row);
|
||||
$('#popup_edit_longdescription_partnumber').html($('#partnumber_' + row).val() || '');
|
||||
var description = ($('#description_' + row).val() || '').replace(/[\n\r]+/, '');
|
||||
if (description.length >= 50)
|
||||
description = description.substring(0, 50) + "…";
|
||||
$('#popup_edit_longdescription_description').html(description);
|
||||
kivi.popup_dialog({
|
||||
id: 'edit_longdescription_dialog',
|
||||
dialog: {
|
||||
5f6d6d4e | Moritz Bunkus | title: kivi.t8('Enter longdescription'),
|
||
open: function() { kivi.set_focus('#popup_edit_longdescription_input'); }
|
||||
ff058663 | Moritz Bunkus | }
|
||
});
|
||||
};
|
||||
this.set_longdescription = function() {
|
||||
var $edit = $('#popup_edit_longdescription_input');
|
||||
var $element = $edit.data('element');
|
||||
$element.val($edit.val());
|
||||
$('#edit_longdescription_dialog').dialog('close');
|
||||
};
|
||||
});
|