Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3751 from stephaniehobson/1235075-sidebard-toggle…
Browse files Browse the repository at this point in the history
…-remove

Fix Bug 1235075: Remove show/hide toggle
  • Loading branch information
openjck committed Jan 13, 2016
2 parents a79caf6 + 8a34bd5 commit 18c816a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 55 deletions.
34 changes: 2 additions & 32 deletions kuma/static/js/wiki.js
Expand Up @@ -7,43 +7,13 @@
$('.toggleable').mozTogglers();

/*
Toggle for quick links show/hide
Toggle for quick links with nested lists
*/
(function() {
// Set up the quick links for the toggler
// Set up the quick links with the toggler
var $quickLinks = $('#quick-links');
setupTogglers($quickLinks.find('> ul > li, > ol > li'));
$quickLinks.find('.toggleable').mozTogglers();

var $columnContainer = $('#wiki-column-container');
var $quickLinksControl = $('#wiki-controls .quick-links');

var child = $('#wiki-left').get(0);
if(child) {
var parent = child.parentNode;
}

// Quick Link toggles
$('#quick-links-toggle, #show-quick-links').on('click', function(e) {
e.preventDefault();
$(child).toggleClass('column-closed');
$columnContainer.toggleClass('wiki-left-closed');
$quickLinksControl.toggleClass('hidden');

if($(child).hasClass('column-closed')) {
parent.removeChild(child);
}
else {
parent.appendChild(child);
}

mdn.analytics.trackEvent({
category: 'Wiki',
action: 'Sidebar',
label: (this.id === 'quick-links-toggle' ? 'Hide' : 'Show')
});

});
})();

/*
Expand Down
2 changes: 0 additions & 2 deletions kuma/static/styles/components/wiki/quick-links.styl
Expand Up @@ -95,8 +95,6 @@ $see-also-outdent = 6px;
}

/* items which can be clicked on to toggle */
#show-quick-links,
#quick-links-toggle,
.quick-links .toggleable > a {
display: inline-block;
bidi-style(padding-left, $grid-spacing, padding-right, 0);
Expand Down
6 changes: 1 addition & 5 deletions kuma/static/styles/components/wiki/structure.styl
Expand Up @@ -65,17 +65,13 @@
#wiki-column-container, #wiki-content {
width: auto !important;
}

#quick-links-toggle, #wiki-controls {
display: none;
}
}

/* print styling */
@media print {

/* hide sections not important to the article */
#wiki-left, #wiki-right, #wiki-controls {
#wiki-left, #wiki-right {
display: none;
}
}
16 changes: 0 additions & 16 deletions kuma/wiki/jinja2/wiki/document.html
Expand Up @@ -198,20 +198,6 @@ <h1>{{ document.title }}</h1>
<!-- start the main content container -->
<div id="wiki-column-container" class="{% if show_right %}wiki-right-present{% else %}wiki-right-closed wiki-right-none{% endif %} {% if show_left %}wiki-left-present{% else %}wiki-left-closed wiki-left-none{% endif %}">

{% if show_left and not is_zone_root %}
<!-- additional controls row; hidden unless needed -->
<div id="wiki-controls" class="column-container column-container-reverse">
<div class="column-strip">
<!-- Show TOC "show" link -->
</div>
<div class="column-half">
</div>
<div class="column-strip quick-links hidden">
<a href="#show-quick-links" class="title smaller" id="show-quick-links"><i aria-hidden="true" class="icon-caret-down"></i>{{ _('Show Sidebar') }}</a>
</div>
</div>
{% endif %}

<!-- content row with three strips -->
<div class="column-container column-container-reverse">

Expand Down Expand Up @@ -363,8 +349,6 @@ <h2 class="offscreen">{{ _('Document Tags and Contributors') }}</h2>

{% if not is_zone_root %}

<a href="#quick-links" class="title smaller" id="quick-links-toggle"><i aria-hidden="true" class="icon-caret-up"></i>{{ _('Hide Sidebar') }}</a>

{% if zone_subnav_html %}
<!-- zone subnav -->
{{ get_document_subnav(zone_subnav_html) }}
Expand Down

0 comments on commit 18c816a

Please sign in to comment.