From: Sven Schöling Date: Mon, 9 Sep 2013 16:24:54 +0000 (+0200) Subject: Preisinformationen erst laden, wenn der Tab aktiv wird. X-Git-Tag: release-3.1.0beta1~69^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=78fdc15567ff867735b78c7b21585e982b7f3ead;p=kivitendo-erp.git Preisinformationen erst laden, wenn der Tab aktiv wird. Reduziert den Request load weiter --- diff --git a/templates/webpages/ic/sales_price_information.html b/templates/webpages/ic/sales_price_information.html index d7b92bd15..4f5794cb4 100644 --- a/templates/webpages/ic/sales_price_information.html +++ b/templates/webpages/ic/sales_price_information.html @@ -20,9 +20,12 @@ get_report(target, event.target + '', {}); } - $(document).ready(function(){ - get_report('#sales_price_information_sales_order', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_order' }); - get_report('#sales_price_information_sales_quotation', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_quotation' }); + $('.tabwidget').on('tabsbeforeactivate', function(event, ui){ + if (ui.newPanel.attr('id') == 'sales_price_information') { + get_report('#sales_price_information_sales_order', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_order' }); + get_report('#sales_price_information_sales_quotation', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_quotation' }); + } + return 1; });