Change information overlay to use toggle component.

This switches from a custom tab interface to the toggle component
layout.
This commit is contained in:
brockwhittaker
2017-01-30 11:55:39 -08:00
committed by Tim Abbott
parent 47a3ce2d35
commit 2ef8e425d1
3 changed files with 20 additions and 27 deletions

View File

@@ -280,6 +280,24 @@ exports.lightbox = function (data) {
popovers.hide_all(); popovers.hide_all();
}; };
$(document).ready(function () {
var info_overlay_toggle = components.toggle({
name: "info-overlay-toggle",
selected: 0,
values: [
{ label: "Keyboard Shortcuts" },
{ label: "Message Formatting" },
{ label: "Search Help" },
],
callback: function () {
}
}).get();
$(".informational-overlays .overlay-tabs")
.append($(info_overlay_toggle).addClass("large"));
});
exports.show_info_overlay = function (target) { exports.show_info_overlay = function (target) {
var el = { var el = {
tabs: $(".informational-overlays .tab"), tabs: $(".informational-overlays .tab"),

View File

@@ -42,30 +42,9 @@
} }
.informational-overlays .overlay-tabs { .informational-overlays .overlay-tabs {
padding: 10px 0px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
background-color: #888;
}
.informational-overlays .overlay-tabs .tab {
float: left;
width: calc(33.33% - 1.1px);
text-align: center; text-align: center;
padding: 12px 0px;
border-right: 1px solid #eee;
background-color: #fff;
cursor: pointer;
}
.informational-overlays .overlay-tabs .tab:last-of-type {
border-right: none;
}
.informational-overlays .overlay-tabs .tab.active {
background-color: #888;
color: #fff;
border-color: transparent;
} }
.informational-overlays .overlay-modal .modal-body { .informational-overlays .overlay-modal .modal-body {

View File

@@ -123,14 +123,10 @@ var page_params = {{ page_params }};
{% include "zerver/image-overlay.html" %} {% include "zerver/image-overlay.html" %}
{% include "zerver/subscriptions.html" %} {% include "zerver/subscriptions.html" %}
</div><!--/row--> </div><!--/row-->
<div class="informational-overlays"> <div class="informational-overlays new-style">
<div class="overlay-content"> <div class="overlay-content">
<h1>Zulip Usage Guide</h1> <h1>Zulip Usage Guide</h1>
<div class="overlay-tabs"> <div class="overlay-tabs">
<div class="tab active" data-overlay-trigger="keyboard-shortcuts">Keyboard Shortcuts</div>
<div class="tab" data-overlay-trigger="search-operators">Search Help</div>
<div class="tab last" data-overlay-trigger="markdown-help">Markdown Formatting</div>
<div class="float-clear"></div>
</div> </div>
<div class="overlay-body"> <div class="overlay-body">
{% include "zerver/keyboard_shortcuts.html" %} {% include "zerver/keyboard_shortcuts.html" %}