|
1993 | 1993 | onEach(e.getElementsByClassName('associatedconstant'), func);
|
1994 | 1994 | });
|
1995 | 1995 |
|
1996 |
| - function createToggle(otherMessage, extraClass) { |
| 1996 | + function createToggle(otherMessage, fontSize, extraClass) { |
1997 | 1997 | var span = document.createElement('span');
|
1998 | 1998 | span.className = 'toggle-label';
|
1999 | 1999 | span.style.display = 'none';
|
2000 | 2000 | if (!otherMessage) {
|
2001 | 2001 | span.innerHTML = ' Expand description';
|
2002 | 2002 | } else {
|
2003 | 2003 | span.innerHTML = otherMessage;
|
2004 |
| - span.style.fontSize = '20px'; |
| 2004 | + } |
| 2005 | + |
| 2006 | + if (fontSize) { |
| 2007 | + span.style.fontSize = fontSize; |
2005 | 2008 | }
|
2006 | 2009 |
|
2007 | 2010 | var mainToggle = toggle.cloneNode(true);
|
|
2040 | 2043 | }
|
2041 | 2044 | if (e.parentNode.id === "main") {
|
2042 | 2045 | var otherMessage;
|
| 2046 | + var fontSize; |
2043 | 2047 | var extraClass;
|
| 2048 | + |
2044 | 2049 | if (hasClass(e, "type-decl")) {
|
| 2050 | + fontSize = "20px"; |
2045 | 2051 | otherMessage = ' Show declaration';
|
| 2052 | + } else if (hasClass(e, "non-exhaustive")) { |
| 2053 | + otherMessage = ' This '; |
| 2054 | + if (hasClass(e, "non-exhaustive-struct")) { |
| 2055 | + otherMessage += 'struct'; |
| 2056 | + } else if (hasClass(e, "non-exhaustive-enum")) { |
| 2057 | + otherMessage += 'enum'; |
| 2058 | + } else if (hasClass(e, "non-exhaustive-type")) { |
| 2059 | + otherMessage += 'type'; |
| 2060 | + } |
| 2061 | + otherMessage += ' is marked as non-exhaustive'; |
2046 | 2062 | } else if (hasClass(e.childNodes[0], "impl-items")) {
|
2047 | 2063 | extraClass = "marg-left";
|
2048 | 2064 | }
|
2049 |
| - e.parentNode.insertBefore(createToggle(otherMessage, extraClass), e); |
| 2065 | + |
| 2066 | + e.parentNode.insertBefore(createToggle(otherMessage, fontSize, extraClass), e); |
2050 | 2067 | if (otherMessage && getCurrentValue('rustdoc-item-declarations') !== "false") {
|
2051 | 2068 | collapseDocs(e.previousSibling.childNodes[0], "toggle");
|
2052 | 2069 | }
|
|
0 commit comments