diff --git a/assets/javascripts/templates/sidebar_tmpl.coffee b/assets/javascripts/templates/sidebar_tmpl.coffee index fb9641c6..41ff565d 100644 --- a/assets/javascripts/templates/sidebar_tmpl.coffee +++ b/assets/javascripts/templates/sidebar_tmpl.coffee @@ -9,22 +9,23 @@ templates.sidebarDoc = (doc, options = {}) -> else link += """""" link += """#{doc.release}""" if doc.release - link += "#{doc.name}" + link += """#{doc.name}""" link += " #{doc.version}" if options.disabled and doc.version - link + "" + link + "" templates.sidebarType = (type) -> - """#{type.count}#{type.name}""" + """#{type.count}#{type.name}""" templates.sidebarEntry = (entry) -> """#{$.escape entry.name}""" templates.sidebarResult = (entry) -> - addon = if entry.isIndex() and app.disabledDocs.contains(entry.doc) + addons = if entry.isIndex() and app.disabledDocs.contains(entry.doc) """Enable""" else """""" - """#{addon}#{$.escape entry.name}""" + addons += """#{entry.doc.version}""" if entry.doc.version + """#{addons}#{$.escape entry.name}""" templates.sidebarNoResults = -> html = """
No results.
""" @@ -41,7 +42,7 @@ templates.sidebarLabel = (doc, options = {}) -> label += " _icon-#{doc.icon}" unless doc.version label += """">#{doc.fullName}" + label + """>#{doc.fullName}""" templates.sidebarVersionedDoc = (doc, versions, options = {}) -> html = """
unless el is @cursor @hide() - if @isTarget(el) and @isTruncated(el) + if @isTarget(el) and @isTruncated(el.lastElementChild or el) @cursor = el @clone = @makeClone @cursor $.append document.body, @clone @@ -48,8 +48,7 @@ class app.views.SidebarHover extends app.View return makeClone: (el) -> - clone = el.cloneNode() - clone.textContent = el.textContent + clone = el.cloneNode(true) clone.classList.add 'clone' clone diff --git a/assets/stylesheets/components/_sidebar.scss b/assets/stylesheets/components/_sidebar.scss index 2d878aa0..d20dea09 100644 --- a/assets/stylesheets/components/_sidebar.scss +++ b/assets/stylesheets/components/_sidebar.scss @@ -80,14 +80,9 @@ ._list-item { display: block; position: relative; - overflow: hidden; padding: .25rem .75rem; line-height: 1.5rem; font-size: .875rem; - white-space: nowrap; - word-wrap: normal; - overflow-wrap: normal; - text-overflow: ellipsis; cursor: default; background: $sidebarBackground; box-shadow: inset -1px 0 $sidebarBorder; @@ -120,9 +115,23 @@ } } +._list-item, ._list-text { + overflow: hidden; + white-space: nowrap; + word-wrap: normal; + overflow-wrap: normal; + text-overflow: ellipsis; +} + +._list-text { + display: block; + pointer-events: none; +} + ._list-count, ._list-enable { float: right; font-size: .75rem; + margin-left: .375rem; .focus > &, .active > & { @@ -229,6 +238,7 @@ padding-right: 1.75rem; > ._list-reveal { display: block; } + > ._list-count { display: none; } } ._list-reveal { @@ -237,14 +247,14 @@ top: 0; bottom: 0; right: 0; - width: 1.75rem; + width: 2rem; cursor: pointer; &:before { content: ''; position: absolute; bottom: 50%; - left: .5rem; + left: .75rem; width: .75rem; height: 1px; background: rgba($selectionText, .9); @@ -274,9 +284,9 @@ ._list-hover.clone { position: fixed; + overflow: visible; z-index: $hoverZ; left: 0; - overflow: visible; min-width: $sidebarWidth; padding: .25rem .75rem; pointer-events: none; @@ -287,11 +297,15 @@ @media #{$mediumScreen} { min-width: $sidebarMediumWidth; } + > ._list-text { display: inline; } + &:not(._list-result) { padding-left: 2.75rem; &:before { content: none; } } + + ._list-reveal, ._list-enable { display: none; } } //