Commit 89ffe4a6 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/ISTWCMS-4573-m26lebla-add-show-hide-revisions-button' into '3.1.x'

ISTWCMS-4573-m26lebla-add-show-hide-revisions-button

See merge request !194
parents 1f93ce43 cdd54059
......@@ -15,3 +15,24 @@
.is-collapse-enabled .tabs__trigger{
z-index: gesso-z-index(content);
}
// Code for show hide revision/tabs
.uw-show-hide{
background-color: rgb(255, 255, 255);
bottom: 4rem;
color: rgb(150, 23, 46);
cursor: pointer;
display:none;
font-size: 2rem;
height: auto;
padding: 0;
position: fixed;
right:1rem;
text-decoration: none;
width: 2rem;
z-index: gesso-z-index(overlay);
}
.block-local-tasks-block,
.uw-content-moderation{
display:block;
}
// end.
{% set main_classes = 'uw-main' %}
<button class="uw-show-hide" id="revision-show-hide" title="Show/hide revision elements">±</button>
{% for class in classes %}
{% set main_classes = main_classes ~ ' ' ~ class %}
{% endfor %}
<main id="main" class="{{ main_classes }}" role="main" tabindex="-1">
{% block content %}
Main content
......
/**
* Javascript for buttons
*/
(function ($, Drupal) {
Drupal.behaviors.buttons = {
attach: function (context, settings) {
// Only show the show/hide button if the user is logged in and on the "view", "layout", or "latest version" tabs.
// (We have picked elements that should only exist on those pages, and only when the user has editing access.)
$(document).ready(
function () {
if ($('.user-logged-in .uw-content-moderation, .user-logged-in #edit-moderation-state-wrapper, .user-logged-in #block-tabs a.is-active[href$=\'latest\']').length) {
$('.uw-show-hide').show().on(
'click', function () {
toggleTabs();
}
);
}
function toggleTabs()
{
var x = document.getElementById('block-tabs');
var y = document.getElementsByClassName('uw-content-moderation')[0];
var z = document.getElementById('edit-moderation-state-wrapper');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
if (y) {
if (y.style.display === 'none') {
y.style.display = 'block';
} else {
y.style.display = 'none';
}
}
if (z) {
if (z.style.display === 'none') {
z.style.display = 'block';
} else {
z.style.display = 'none';
}
}
}
}
);
}
};
})(jQuery, Drupal);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment