Skip to content

Commit

Permalink
Merge pull request #8622 from NuGet/dg-a11y-checkmark-profilepage
Browse files Browse the repository at this point in the history
Add accessible popovers to reserved checkmarks
  • Loading branch information
drewgillies authored Jun 8, 2021
2 parents c159a02 + bd259cd commit 9b3cf4a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/NuGetGallery/Scripts/gallery/page-display-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,19 @@ $(function () {
}
});
}

// Add popover to reserved check mark
$(".reserved-indicator").each(
function () {
var checkmarkImage = $(this);
checkmarkImage.popover({ trigger: 'hover focus' });
checkmarkImage.click(function () {
checkmarkImage.popover('show');
setTimeout(function () {
checkmarkImage.popover('destroy');
},
1000);
});
}
);
});
2 changes: 1 addition & 1 deletion src/NuGetGallery/Views/Packages/DisplayPackage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
<img class="reserved-indicator"
src="~/Content/gallery/img/reserved-indicator.svg"
@ViewHelpers.ImageFallback(Url.Absolute("~/Content/gallery/img/reserved-indicator-25x25.png"))
title="@Strings.ReservedNamespace_ReservedIndicatorTooltip" />
data-content="@Strings.ReservedNamespace_ReservedIndicatorTooltip" tabindex="0"/>
}
</h1>

Expand Down
4 changes: 4 additions & 0 deletions src/NuGetGallery/Views/Users/Profiles.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@
</article>
</div>
</section>

@section BottomScripts {
@Scripts.Render("~/Scripts/gallery/page-list-packages.min.js")
}

0 comments on commit 9b3cf4a

Please sign in to comment.