diff options
author | Cheng-Han, Wu | 2016-04-20 18:22:18 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-04-20 18:22:18 +0800 |
commit | b40bf3aef7359c181eea04c06ec52b62cc72aaaf (patch) | |
tree | 7a6bc6873b4515835671d4ca38bbd3c4860390a3 /public/js | |
parent | 7e69bfc40b25f06618d1dbe744256e9a0d12280a (diff) |
Update to support octicon and change header anchor styles
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/extra.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index 83d62d4d..fd9fba6b 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -613,9 +613,9 @@ function imgPlayiframe(element, src) { var anchorForId = function (id) { var anchor = document.createElement("a"); - anchor.className = "header-link hidden-xs"; + anchor.className = "anchor hidden-xs"; anchor.href = "#" + id; - anchor.innerHTML = "<span class=\"sr-only\"></span><i class=\"fa fa-link\"></i>"; + anchor.innerHTML = "<span class=\"octicon octicon-link\"></span>"; anchor.title = id; return anchor; }; @@ -624,13 +624,13 @@ var linkifyAnchors = function (level, containingElement) { var headers = containingElement.getElementsByTagName("h" + level); for (var h = 0; h < headers.length; h++) { var header = headers[h]; - if (header.getElementsByClassName("header-link").length == 0) { + if (header.getElementsByClassName("anchor").length == 0) { if (typeof header.id == "undefined" || header.id == "") { //to escape characters not allow in css and humanize var id = slugifyWithUTF8(header.innerHTML); header.id = id; } - header.appendChild(anchorForId(header.id)); + header.insertBefore(anchorForId(header.id), header.firstChild); } } }; |