Fix readme edit link
This commit is contained in:
parent
e77cd681e1
commit
8c06f61376
|
@ -92,7 +92,7 @@ let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt")
|
||||||
let readme = $("#readme");
|
let readme = $("#readme");
|
||||||
if (!readme.length) return;
|
if (!readme.length) return;
|
||||||
|
|
||||||
let name = readme.find("h3").text().trim();
|
let name = readme.find("h3:first").text().trim();
|
||||||
let branch = $(".file-navigation > .select-menu.float-left > button > .js-select-button").text();
|
let branch = $(".file-navigation > .select-menu.float-left > button > .js-select-button").text();
|
||||||
let editUrl = `${repoUrl}/edit/${branch}/${name}`;
|
let editUrl = `${repoUrl}/edit/${branch}/${name}`;
|
||||||
|
|
||||||
|
@ -100,9 +100,9 @@ let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt")
|
||||||
div.attr("id", "readme-edit-link");
|
div.attr("id", "readme-edit-link");
|
||||||
div.css("position", "absolute");
|
div.css("position", "absolute");
|
||||||
div.css("top", "10px");
|
div.css("top", "10px");
|
||||||
div.css("right", "40px");
|
div.css("right", "10px");
|
||||||
div.css("opacity", "0.2");
|
div.css("opacity", "0.2");
|
||||||
div.css("transform", "opacity 250ms");
|
div.css("transition", "opacity 250ms");
|
||||||
|
|
||||||
let a = $("<a></a>");
|
let a = $("<a></a>");
|
||||||
a.attr("href", editUrl);
|
a.attr("href", editUrl);
|
||||||
|
@ -116,7 +116,7 @@ let currentUser = $("ul.header-nav.float-right > li:last > a > img").attr("alt")
|
||||||
|
|
||||||
addStyle(`
|
addStyle(`
|
||||||
#readme.blob #readme-edit-link { display: none; }
|
#readme.blob #readme-edit-link { display: none; }
|
||||||
#readme-edit-link:hover { opacity: 1; }
|
#readme-edit-link:hover { opacity: 1 !important; }
|
||||||
`);
|
`);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue