From 6de748ebc2988fcee33efc95d164182b035d0352 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 6 Aug 2017 11:59:50 -0400 Subject: [PATCH] Add 'Customize' link next to 'Disabled' list title Rel: #189 --- assets/javascripts/templates/sidebar_tmpl.coffee | 2 +- assets/javascripts/views/sidebar/doc_list.coffee | 2 +- assets/stylesheets/components/_sidebar.scss | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/templates/sidebar_tmpl.coffee b/assets/javascripts/templates/sidebar_tmpl.coffee index 21c1e090..dd9ef5a3 100644 --- a/assets/javascripts/templates/sidebar_tmpl.coffee +++ b/assets/javascripts/templates/sidebar_tmpl.coffee @@ -52,7 +52,7 @@ templates.sidebarVersionedDoc = (doc, versions, options = {}) -> html + """" tabindex="0">#{arrow}#{doc.name}
#{versions}
""" templates.sidebarDisabled = (options) -> - """
#{arrow}Disabled (#{options.count})
""" + """
#{arrow}Disabled (#{options.count}) Customize
""" templates.sidebarDisabledList = (html) -> """
#{html}
""" diff --git a/assets/javascripts/views/sidebar/doc_list.coffee b/assets/javascripts/views/sidebar/doc_list.coffee index 2f132109..55c8fd20 100644 --- a/assets/javascripts/views/sidebar/doc_list.coffee +++ b/assets/javascripts/views/sidebar/doc_list.coffee @@ -164,7 +164,7 @@ class app.views.DocList extends app.View return onClick: (event) => - if @disabledTitle and $.hasChild(@disabledTitle, event.target) + if @disabledTitle and $.hasChild(@disabledTitle, event.target) and event.target.tagName isnt 'A' $.stopEvent(event) @toggleDisabled() else if slug = event.target.getAttribute('data-enable') diff --git a/assets/stylesheets/components/_sidebar.scss b/assets/stylesheets/components/_sidebar.scss index 239cab05..04f1ce7e 100644 --- a/assets/stylesheets/components/_sidebar.scss +++ b/assets/stylesheets/components/_sidebar.scss @@ -75,7 +75,7 @@ ._list-title { position: relative; margin: .5rem 0 0; - padding-left: 2.25rem; + padding: 0 .75rem 0 2.25rem; line-height: 2rem; font-size: .75rem; color: $textColorLight; @@ -83,6 +83,15 @@ cursor: default; } +._list-title-link { + display: none; + float: right; + font-weight: normal; + text-transform: none; + + ._list-title:hover > & { display: block; } +} + ._list-item { display: block; position: relative;