Revision 525f4f88
Von Sven Schöling vor 5 Monaten hinzugefügt
js/kivi.Order.js | ||
---|---|---|
$('#row_table_scroll_id').scrollTop($('#row_table_scroll_id')[0].scrollHeight);
|
||
};
|
||
|
||
ns.scroll_page_after_row_insert = function(id) {
|
||
// find row height and border spacing
|
||
const $id_input = $('input[name="orderitem_ids[+]"][value="'+id+'"]');
|
||
const $row = $id_input.closest('tbody');
|
||
const table = $row.closest('table')[0];
|
||
const style = getComputedStyle(table);
|
||
|
||
const height = $row[0].offsetHeight + parseFloat(style.borderSpacing) || 0;
|
||
|
||
// if site is scrollable and scrolling can put it where it was before: do scroll
|
||
const max_scroll = document.documentElement.scrollHeight - window.innerHeight;
|
||
|
||
if (window.scrollY + height <= max_scroll) {
|
||
window.scrollBy(0, height)
|
||
}
|
||
}
|
||
|
||
ns.show_longdescription_dialog = function(clicked) {
|
||
var row = $(clicked).parents("tbody").first();
|
||
var position = $(row).find('[name="position"]').html();
|
Auch abrufbar als: Unified diff
Artikeleingabe unten: alternatives Scrollverhalten wenn Positionsliste ohne Scrollbereich
Wenn die Artikeleingabe unten gerendert wird, und die Positionsliste
nicht begrenzt ist, gilt jetzt folgendes Verhalten:
Wenn nach dem Einfügen der neuen Zeile die Seite scrollbar ist, und
durch scrollen die Eingabeleite auf konstanter Höhe gehalten werden
kann, dann wird so gescrollt.