Improve docs hovercard and nonstandard notice

This commit is contained in:
Matthew Holt 2021-10-12 14:51:36 -06:00
parent 773e99ec6e
commit f3f21afac0
2 changed files with 5 additions and 4 deletions

View file

@ -453,6 +453,7 @@ iframe {
padding: 10px;
color: #886c00;
line-height: 1.4em;
display: none;
}
.nonstandard {
@ -519,6 +520,8 @@ article .json a {
position: absolute;
font-size: 16px;
transition: transform .25s ease-in-out, opacity .25s ease-in-out;
max-height: 50%;
overflow-y: auto;
}
#hovercard:not(.popup) {

View file

@ -164,13 +164,11 @@ function beginRenderingInto($tpl, moduleID, module) {
// show notice if module is non-standard
if (module.repo) {
if (isStandard(module.structure.type_name)) {
$('.nonstandard-notice', $tpl).remove();
} else {
if (!isStandard(module.structure.type_name)) {
let { pkg, _ } = splitTypeName(module.structure.type_name);
$('.nonstandard-project-link', $tpl).attr('href', module.repo).text(module.repo);
$('.nonstandard-package-path', $tpl).text(pkg);
$('.nonstandard-notice', $tpl).prepend(nonStandardFlag);
$('.nonstandard-notice', $tpl).prepend(nonStandardFlag).show();
}
var $repoName = $('<span/>').text(stripScheme(module.repo));