Skip to content

Commit e4ba227

Browse files
Copy button not working fix (#10611)
1 parent fb2b80f commit e4ba227

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/NuGetGallery/Views/Packages/DisplayPackage.cshtml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,17 +1621,18 @@
16211621
</style>
16221622

16231623
<script type="text/javascript" nonce="@Html.GetCSPNonce()">
1624-
var packageId = @Html.ToJson(Model.Id);
1625-
var packageVersion = @Html.ToJson(Model.Version);
1626-
var packageManagers = @Html.ToJson(
1624+
window.nuget = window.nuget || {};
1625+
window.nuget.packageId = @Html.ToJson(Model.Id);
1626+
window.nuget.packageVersion = @Html.ToJson(Model.Version);
1627+
window.nuget.packageManagers = @Html.ToJson(
16271628
(
16281629
from pm in packageManagers
16291630
from ipc in pm.InstallPackageCommands
16301631
select ipc.Key
16311632
)
16321633
.ToList()
16331634
);
1634-
var sponsorshipUrlCount = @sponsorshipUrlCount;
1635+
window.nuget.sponsorshipUrlCount = @sponsorshipUrlCount;
16351636
</script>
16361637

16371638
@if (Model.IsMarkdigMdSyntaxHighlightEnabled)

0 commit comments

Comments
 (0)