bug fix #162 document template id closure not updated on subsequent invoke
This commit is contained in:
@@ -1 +1 @@
|
||||
(function(n,t,i){i(function(){let f=null;const r=i("#Document_Generation_Container"),u=r.find("#Document_Generate"),e=r.attr("data-targetid"),v=r.attr("data-targettype"),s=r.attr("data-generatepdfurl"),h=r.attr("data-generatepackageurl"),c=r.attr("data-handlerspresent")==="true",l=r.attr("data-handlersurl");let t=null;const o=function(t){let r;r=t.lastIndexOf("Package:",0)===0?h+t.substring(8):s+t;r=r+"?TargetId="+e;i.connection&&i.connection.hub&&i.connection.hub.transport&&i.connection.hub.transport.name=="foreverFrame"?n.open(r,"_blank","height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no"):f?f[0].location.href=r:f=i("<iframe>").attr({src:r,title:"Document Generation Host"}).addClass("hidden").appendTo("body").contents()},a=function(n){const u=t.find(".handlerPicker"),f=t.find("#Document_Generation_Dialog_Handlers_Loading");u.find("div.handler").remove();f.show();var r=new FormData;r.append("templateId",decodeURI(n));r.append("targetId",decodeURI(e));fetch(l,{method:"POST",body:r}).then(n=>n.json()).then(n=>{f.hide(),i.each(n.Handlers,(n,t)=>{i('<div class="handler">').text(t.Title).attr({"data-id":t.Id,"data-uiurl":t.UiUrl}).prepend(i('<i class="fa fa-fw fa-lg">').addClass("fa-"+t.Icon)).appendTo(u)})})};u.change(function(){var n=u.val();if(n){if(c){if(!t){t=r.find("#Document_Generation_Dialog");t.dialog({width:750,height:500,resizable:!1,modal:!0,autoOpen:!1,buttons:{Cancel:function(){i(this).dialog("close")}}});t.find("#Document_Generation_Dialog_Download").click(i=>(i.preventDefault(),o(n),t.dialog("close"),!1));const f=t.find(".handlerPicker"),e=t.find("#Document_Generation_Dialog_Download_Container"),u=t.find("#Document_Generation_Dialog_HandlerUI");f.on("click","div[data-id]",n=>{f.find("div").removeClass("selected");const t=i(n.currentTarget);t.addClass("selected");const r=t.attr("data-id");if(r==="download")e.show(),u.hide(),u.empty();else{e.hide();u.empty();u.show();const n=t.attr("data-uiurl");fetch(n,{method:"POST"}).then(n=>n.text()).then(n=>{u.html(n)})}})}const f=t.find(".handlerPicker"),s=t.find("#Document_Generation_Dialog_Download_Container"),e=t.find("#Document_Generation_Dialog_HandlerUI");f.find("div").removeClass("selected");f.find("div[data-id=download]").addClass("selected");s.show();e.hide();e.empty();t.dialog("option","title","Generate Document: "+u[0].selectedOptions[0].label);t.dialog("open");a(n)}else o(n);u.val("").blur()}})})})(window,document,$);
|
||||
(function(n,t,i){i(function(){let f=null;const r=i("#Document_Generation_Container"),u=r.find("#Document_Generate"),e=r.attr("data-targetid"),y=r.attr("data-targettype"),h=r.attr("data-generatepdfurl"),c=r.attr("data-generatepackageurl"),l=r.attr("data-handlerspresent")==="true",a=r.attr("data-handlersurl");let t=null,o=null;const s=function(t){let r;r=t.lastIndexOf("Package:",0)===0?c+t.substring(8):h+t;r=r+"?TargetId="+e;i.connection&&i.connection.hub&&i.connection.hub.transport&&i.connection.hub.transport.name=="foreverFrame"?n.open(r,"_blank","height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no"):f?f[0].location.href=r:f=i("<iframe>").attr({src:r,title:"Document Generation Host"}).addClass("hidden").appendTo("body").contents()},v=function(n){const u=t.find(".handlerPicker"),f=t.find("#Document_Generation_Dialog_Handlers_Loading");u.find("div.handler").remove();f.show();var r=new FormData;r.append("templateId",decodeURI(n));r.append("targetId",decodeURI(e));fetch(a,{method:"POST",body:r}).then(n=>n.json()).then(n=>{f.hide(),i.each(n.Handlers,(n,t)=>{i('<div class="handler">').text(t.Title).attr({"data-id":t.Id,"data-uiurl":t.UiUrl}).prepend(i('<i class="fa fa-fw fa-lg">').addClass("fa-"+t.Icon)).appendTo(u)})})};u.change(function(){var n=u.val();if(n){if(o=n,l){if(!t){t=r.find("#Document_Generation_Dialog");t.dialog({width:750,height:500,resizable:!1,modal:!0,autoOpen:!1,buttons:{Cancel:function(){i(this).dialog("close")}}});t.find("#Document_Generation_Dialog_Download").click(n=>(n.preventDefault(),s(o),t.dialog("close"),!1));const u=t.find(".handlerPicker"),f=t.find("#Document_Generation_Dialog_Download_Container"),n=t.find("#Document_Generation_Dialog_HandlerUI");u.on("click","div[data-id]",t=>{u.find("div").removeClass("selected");const r=i(t.currentTarget);r.addClass("selected");const e=r.attr("data-id");if(e==="download")f.show(),n.hide(),n.empty();else{f.hide();n.empty();n.show();const t=r.attr("data-uiurl");fetch(t,{method:"POST"}).then(n=>n.text()).then(t=>{n.html(t)})}})}const f=t.find(".handlerPicker"),h=t.find("#Document_Generation_Dialog_Download_Container"),e=t.find("#Document_Generation_Dialog_HandlerUI");f.find("div").removeClass("selected");f.find("div[data-id=download]").addClass("selected");h.show();e.hide();e.empty();t.dialog("option","title","Generate Document: "+u[0].selectedOptions[0].label);t.dialog("open");v(n)}else s(n);u.val("").blur()}})})})(window,document,$);
|
||||
Reference in New Issue
Block a user