From 78fdc15567ff867735b78c7b21585e982b7f3ead Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 9 Sep 2013 18:24:54 +0200 Subject: [PATCH] Preisinformationen erst laden, wenn der Tab aktiv wird. Reduziert den Request load weiter --- templates/webpages/ic/sales_price_information.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; }); -- 2.20.1