diff --git a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml index e6143531..794543b9 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml +++ b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml @@ -228,10 +228,30 @@ $(function () { var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null))?DocumentTemplateId='; var $documentTemplates = $('#Device_Show_GenerateDocument'); + var $generationHost; + $documentTemplates.change(function () { var v = $documentTemplates.val(); if (v) { - window.location.href = generatePdfUrl + v; + var url = generatePdfUrl + v; + + if ($.connection && $.connection.hub && $.connection.hub.transport && + $.connection.hub.transport.name == 'foreverFrame') { + // SignalR active with foreverFrame transport - use popup window + window.open(url, '_blank', 'height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); + } else { + // use iFrame + if (!$generationHost) { + $generationHost = $('