Revision 94f5cb15
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
js/kivi.SalesPurchase.js | ||
---|---|---|
1 | 1 |
namespace('kivi.SalesPurchase', function(ns) { |
2 |
this.longdescription_dialog_size_percentage = 0; |
|
3 |
|
|
2 | 4 |
this.edit_longdescription = function(row) { |
3 | 5 |
var $element = $('#longdescription_' + row); |
4 | 6 |
|
... | ... | |
17 | 19 |
}; |
18 | 20 |
|
19 | 21 |
this.edit_longdescription_with_params = function(params) { |
22 |
var dialog_width = 800; |
|
23 |
var dialog_height = 500; |
|
24 |
var textarea_width = 750; |
|
25 |
var textarea_height = 220; |
|
26 |
if (this.longdescription_dialog_size_percentage != 0) { |
|
27 |
dialog_width = Math.ceil(window.innerWidth * this.longdescription_dialog_size_percentage/100); |
|
28 |
dialog_height = Math.ceil(window.innerHeight * this.longdescription_dialog_size_percentage/100); |
|
29 |
textarea_width = Math.ceil(dialog_width * 95/100); |
|
30 |
textarea_height = dialog_height - 220; |
|
31 |
if (textarea_height <= 0) textarea_height = 220; |
|
32 |
} |
|
33 |
|
|
20 | 34 |
var $container = $('#popup_edit_longdescription_input_container'); |
21 |
var $edit = $('<textarea id="popup_edit_longdescription_input" class="texteditor-in-dialog texteditor-space-for-toolbar" wrap="soft" style="width: 750px; height: 220px;"></textarea>');
|
|
35 |
var $edit = $('<textarea id="popup_edit_longdescription_input" class="texteditor-in-dialog texteditor-space-for-toolbar" wrap="soft" style="width: ' + textarea_width + 'px; height: ' + textarea_height + 'px;"></textarea>');
|
|
22 | 36 |
|
23 | 37 |
$container.children().remove(); |
24 | 38 |
$container.append($edit); |
... | ... | |
44 | 58 |
id: 'edit_longdescription_dialog', |
45 | 59 |
dialog: { |
46 | 60 |
title: kivi.t8('Enter longdescription'), |
61 |
width: dialog_width, |
|
62 |
height: dialog_height, |
|
47 | 63 |
open: function() { kivi.focus_ckeditor_when_ready('#popup_edit_longdescription_input'); }, |
48 | 64 |
close: function() { $('#popup_edit_longdescription_input_container').children().remove(); } |
49 | 65 |
} |
Auch abrufbar als: Unified diff
Langtext-Dialog: Größe prozentual zum Hauptfenster einstellbar pro Benutzer
Ist hier in der Benutzereinstellung ein Wert != 0 gewählt, so wird der Dialog
entsprechend dargestellt. Auch die Größe des Editor-Bereichs wird in diesem
Fall angpepasst.
Ist 0 oder kein Wert gewählt, so ist das Verhalten wie zuvor.