Ref #25.
Unified · Split
| @@ -9,22 +9,23 @@ templates.sidebarDoc = (doc, options = {}) -> · 8 unmodified lines | ||
| 9 | 9 | else |
| 10 | 10 | link += """<span class="_list-arrow"></span>""" |
| 11 | 11 | link += """<span class="_list-count">#{doc.release}</span>""" if doc.release |
| 12 | − link += "#{doc.name}" | |
| 12 | + link += """<span class="_list-text">#{doc.name}""" | |
| 13 | 13 | link += " #{doc.version}" if options.disabled and doc.version |
| 14 | − link + "</a>" | |
| 14 | + link + "</span></a>" | |
| 15 | 15 | |
| 16 | 16 | templates.sidebarType = (type) -> |
| 17 | − """<a href="#{type.fullPath()}" class="_list-item _list-dir" data-slug="#{type.slug}"><span class="_list-arrow"></span><span class="_list-count">#{type.count}</span>#{type.name}</a>""" | |
| 17 | + """<a href="#{type.fullPath()}" class="_list-item _list-dir" data-slug="#{type.slug}"><span class="_list-arrow"></span><span class="_list-count">#{type.count}</span><span class="_list-text">#{type.name}</span></a>""" | |
| 18 | 18 | |
| 19 | 19 | templates.sidebarEntry = (entry) -> |
| 20 | 20 | """<a href="#{entry.fullPath()}" class="_list-item _list-hover">#{$.escape entry.name}</a>""" |
| 21 | 21 | |
| 22 | 22 | templates.sidebarResult = (entry) -> |
| 23 | − addon = if entry.isIndex() and app.disabledDocs.contains(entry.doc) | |
| 23 | + addons = if entry.isIndex() and app.disabledDocs.contains(entry.doc) | |
| 24 | 24 | """<span class="_list-enable" data-enable="#{entry.doc.slug}">Enable</span>""" |
| 25 | 25 | else |
| 26 | 26 | """<span class="_list-reveal" data-reset-list title="Reveal in list"></span>""" |
| 27 | − """<a href="#{entry.fullPath()}" class="_list-item _list-hover _list-result _icon-#{entry.doc.icon}">#{addon}#{$.escape entry.name}</a>""" | |
| 27 | + addons += """<span class="_list-count">#{entry.doc.version}</span>""" if entry.doc.version | |
| 28 | + """<a href="#{entry.fullPath()}" class="_list-item _list-hover _list-result _icon-#{entry.doc.icon}">#{addons}<span class="_list-text">#{$.escape entry.name}</span></a>""" | |
| 28 | 29 | |
| 29 | 30 | templates.sidebarNoResults = -> |
| 30 | 31 | html = """ <div class="_list-note">No results.</div> """ |
| @@ -41,7 +42,7 @@ templates.sidebarLabel = (doc, options = {}) -> · 10 unmodified lines | ||
| 41 | 42 | label += " _icon-#{doc.icon}" unless doc.version |
| 42 | 43 | label += """"><input type="checkbox" name="#{doc.slug}" class="_list-checkbox" """ |
| 43 | 44 | label += "checked" if options.checked |
| 44 | − label + ">#{doc.fullName}</label>" | |
| 45 | + label + """><span class="_list-text">#{doc.fullName}</span></label>""" | |
| 45 | 46 | |
| 46 | 47 | templates.sidebarVersionedDoc = (doc, versions, options = {}) -> |
| 47 | 48 | html = """<div class="_list-item _list-dir _list-rdir _icon-#{doc.icon}""" |
| @@ -24,7 +24,7 @@ class app.views.SidebarHover extends app.View · 23 unmodified lines | ||
| 24 | 24 | show: (el) -> |
| 25 | 25 | unless el is @cursor |
| 26 | 26 | @hide() |
| 27 | − if @isTarget(el) and @isTruncated(el) | |
| 27 | + if @isTarget(el) and @isTruncated(el.lastElementChild or el) | |
| 28 | 28 | @cursor = el |
| 29 | 29 | @clone = @makeClone @cursor |
| 30 | 30 | $.append document.body, @clone |
| @@ -48,8 +48,7 @@ class app.views.SidebarHover extends app.View · 17 unmodified lines | ||
| 48 | 48 | return |
| 49 | 49 | |
| 50 | 50 | makeClone: (el) -> |
| 51 | − clone = el.cloneNode() | |
| 52 | − clone.textContent = el.textContent | |
| 51 | + clone = el.cloneNode(true) | |
| 53 | 52 | clone.classList.add 'clone' |
| 54 | 53 | clone |
| 55 | 54 | |
| @@ -80,14 +80,9 @@ · 79 unmodified lines | ||
| 80 | 80 | ._list-item { |
| 81 | 81 | display: block; |
| 82 | 82 | position: relative; |
| 83 | − overflow: hidden; | |
| 84 | 83 | padding: .25rem .75rem; |
| 85 | 84 | line-height: 1.5rem; |
| 86 | 85 | font-size: .875rem; |
| 87 | − white-space: nowrap; | |
| 88 | − word-wrap: normal; | |
| 89 | − overflow-wrap: normal; | |
| 90 | − text-overflow: ellipsis; | |
| 91 | 86 | cursor: default; |
| 92 | 87 | background: $sidebarBackground; |
| 93 | 88 | box-shadow: inset -1px 0 $sidebarBorder; |
| @@ -120,9 +115,23 @@ · 26 unmodified lines | ||
| 120 | 115 | } |
| 121 | 116 | } |
| 122 | 117 | |
| 118 | +._list-item, ._list-text { | |
| 119 | + overflow: hidden; | |
| 120 | + white-space: nowrap; | |
| 121 | + word-wrap: normal; | |
| 122 | + overflow-wrap: normal; | |
| 123 | + text-overflow: ellipsis; | |
| 124 | +} | |
| 125 | + | |
| 126 | +._list-text { | |
| 127 | + display: block; | |
| 128 | + pointer-events: none; | |
| 129 | +} | |
| 130 | + | |
| 123 | 131 | ._list-count, ._list-enable { |
| 124 | 132 | float: right; |
| 125 | 133 | font-size: .75rem; |
| 134 | + margin-left: .375rem; | |
| 126 | 135 | |
| 127 | 136 | .focus > &, |
| 128 | 137 | .active > & { |
| @@ -229,6 +238,7 @@ · 100 unmodified lines | ||
| 229 | 238 | padding-right: 1.75rem; |
| 230 | 239 | |
| 231 | 240 | > ._list-reveal { display: block; } |
| 241 | + > ._list-count { display: none; } | |
| 232 | 242 | } |
| 233 | 243 | |
| 234 | 244 | ._list-reveal { |
| @@ -237,14 +247,14 @@ · 2 unmodified lines | ||
| 237 | 247 | top: 0; |
| 238 | 248 | bottom: 0; |
| 239 | 249 | right: 0; |
| 240 | − width: 1.75rem; | |
| 250 | + width: 2rem; | |
| 241 | 251 | cursor: pointer; |
| 242 | 252 | |
| 243 | 253 | &:before { |
| 244 | 254 | content: ''; |
| 245 | 255 | position: absolute; |
| 246 | 256 | bottom: 50%; |
| 247 | − left: .5rem; | |
| 257 | + left: .75rem; | |
| 248 | 258 | width: .75rem; |
| 249 | 259 | height: 1px; |
| 250 | 260 | background: rgba($selectionText, .9); |
| @@ -274,9 +284,9 @@ · 23 unmodified lines | ||
| 274 | 284 | |
| 275 | 285 | ._list-hover.clone { |
| 276 | 286 | position: fixed; |
| 287 | + overflow: visible; | |
| 277 | 288 | z-index: $hoverZ; |
| 278 | 289 | left: 0; |
| 279 | − overflow: visible; | |
| 280 | 290 | min-width: $sidebarWidth; |
| 281 | 291 | padding: .25rem .75rem; |
| 282 | 292 | pointer-events: none; |
| @@ -287,11 +297,15 @@ · 4 unmodified lines | ||
| 287 | 297 | |
| 288 | 298 | @media #{$mediumScreen} { min-width: $sidebarMediumWidth; } |
| 289 | 299 | |
| 300 | + > ._list-text { display: inline; } | |
| 301 | + | |
| 290 | 302 | &:not(._list-result) { |
| 291 | 303 | padding-left: 2.75rem; |
| 292 | 304 | |
| 293 | 305 | &:before { content: none; } |
| 294 | 306 | } |
| 307 | + | |
| 308 | + ._list-reveal, ._list-enable { display: none; } | |
| 295 | 309 | } |
| 296 | 310 | |
| 297 | 311 | // |