X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=js%2Fkivi.File.js;h=63a85346c7a6c5f21ce8dd17aa87c92543539994;hb=feb6f563968f53e59511578429b1dd61fda52008;hp=bdd7acd361e205a9607cfa5138d9ced7832d93aa;hpb=0959c4afa29a4bab16f405e016f06d18fb4ecb23;p=kivitendo-erp.git diff --git a/js/kivi.File.js b/js/kivi.File.js index bdd7acd36..63a85346c 100644 --- a/js/kivi.File.js +++ b/js/kivi.File.js @@ -393,4 +393,20 @@ namespace('kivi.File', function(ns) { $('.overlay_div img').on('click', ns.download); }; + ns.doc_tab_init = function(tabs_id, doc_tab_id, id, object_type) { + var url = 'controller.pl?action=File/list&file_type=document&object_type=' + object_type + '&object_id=' + $('#id').val(); + + $('#' + tabs_id).on('tabsbeforeactivate', function(e, ui) { + if (ui.newPanel.attr('id') !== doc_tab_id) return; + $('#' + doc_tab_id).html(kivi.t8('Loading...')); + $('#' + doc_tab_id).load(url); + }); + + $('#' + tabs_id).on('tabscreate', function(e, ui) { + if (ui.panel.attr('id') !== doc_tab_id) return; + $('#' + doc_tab_id).html(kivi.t8('Loading...')); + $('#' + doc_tab_id).load(url); + }); + }; + });