Commit 4213235f authored by Martin Leblanc's avatar Martin Leblanc Committed by Kevin Paxman
Browse files

additional css for the views

parent 1711d258
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -47,76 +47,6 @@
* @file
*/
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.expandcollapse = {
attach: function (context, settings) {
$(document).ready(function () {
$('.uw-expand-collapse').each(function () {
// Get the id of the expand collapse.
var id = '#uw-expand-collapse-' + $(this).data('id');
// When the expand all button is clicked, expand all the items.
$(id + ' [data-type="expand-all"]').click(function () {
// Find each of the buttons, which are the titles and change
// aria-expanded and add class to show expanded.
$(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true);
$(this).addClass('uw-expanded');
});
// Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'block');
});
});
// When the collapse all button is clicked, collapse all the items.
$(id + ' [data-type="collapse-all"]').click(function () {
// Find each of the buttons, which are the titles and change
// aria-expanded and remove class to show collapsed.
$(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true);
$(this).removeClass('uw-expanded');
});
// Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'none');
});
});
// Step through each of the titles and add a click function.
$(id + ' .uw-expand-collapse__items button').click(function () {
// If this has an expanded class, remove it and change aria expanded to false.
// Otherwise add the expanded class and set aria-expanded to true.
if ($(this).hasClass('uw-expanded')) {
$(this).attr('aria-expanded', false);
$(this).removeClass('uw-expanded');
}
else {
$(this).attr('aria-expanded', true);
$(this).addClass('uw-expanded');
}
// Toggle the text to show/hide.
$(this).parent().parent().find('.uw-expand-collapse__text').toggle();
})
});
});
}
};
})(jQuery, Drupal);
/**
* @file
*/
......@@ -310,6 +240,76 @@ else if (e.keyCode === 37) {
};
})(jQuery, Drupal);
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.expandcollapse = {
attach: function (context, settings) {
$(document).ready(function () {
$('.uw-expand-collapse').each(function () {
// Get the id of the expand collapse.
var id = '#uw-expand-collapse-' + $(this).data('id');
// When the expand all button is clicked, expand all the items.
$(id + ' [data-type="expand-all"]').click(function () {
// Find each of the buttons, which are the titles and change
// aria-expanded and add class to show expanded.
$(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true);
$(this).addClass('uw-expanded');
});
// Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'block');
});
});
// When the collapse all button is clicked, collapse all the items.
$(id + ' [data-type="collapse-all"]').click(function () {
// Find each of the buttons, which are the titles and change
// aria-expanded and remove class to show collapsed.
$(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true);
$(this).removeClass('uw-expanded');
});
// Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'none');
});
});
// Step through each of the titles and add a click function.
$(id + ' .uw-expand-collapse__items button').click(function () {
// If this has an expanded class, remove it and change aria expanded to false.
// Otherwise add the expanded class and set aria-expanded to true.
if ($(this).hasClass('uw-expanded')) {
$(this).attr('aria-expanded', false);
$(this).removeClass('uw-expanded');
}
else {
$(this).attr('aria-expanded', true);
$(this).addClass('uw-expanded');
}
// Toggle the text to show/hide.
$(this).parent().parent().find('.uw-expand-collapse__text').toggle();
})
});
});
}
};
})(jQuery, Drupal);
/**
* @file
*/
......
......@@ -2,3 +2,8 @@
// Styles for Content Layout.
// .l-content {}
.uw-main{
&.layout.uw-contained-width{
padding:1rem 0;
}
}
......@@ -12,7 +12,6 @@ $sidebar-width: 18.75rem;
.view {
&s-element-container{
@include uw-contained-width;
padding:0;
position:relative;
}
display: grid;
......@@ -105,7 +104,6 @@ $sidebar-width: 18.75rem;
height:100%;
margin-top:-2.5rem;
overflow: inherit;
padding: 1rem;
width:100%;
z-index: gesso-z-index(overlay);
~ .view-content {
......
<div class="view-content" data-uuid="{{ uuid }}">
<div class="view-content" {% if uuid %} data-uuid="{{ uuid }}" {% endif %}>
{% if rows %}
{{ rows }}
{% endif %}
{% if pattern_lab %}
{% include '@components/content-grid-list/content-grid-list.twig' with {
'lists': lists,
......
......@@ -11,13 +11,13 @@
} %}
{% endif %}
{% if calendar %}
{% include '@components/button/button.twig' with {
'is_button_tag': false,
'is_demo': false,
'url': '#',
'text': 'Calendar',
'modifier_classes': 'button--icon icon--calendar',
} %}
{% include '@components/button/button.twig' with {
'is_button_tag': false,
'is_demo': false,
'url': '#',
'text': 'Calendar',
'modifier_classes': 'button--icon icon--calendar',
} %}
{% endif %}
{% if rss_feed %}
{% include '@components/button/button.twig' with {
......
exposed: true
calendar: 'http://uwat.com'
rss_feed: 'http:uwat.com'
calendar: true
rss_feed: true
......@@ -13,6 +13,9 @@
{% include '@components/view/view-interact/view-interact.twig' %}
{% endif %}
{# If expand and collapse Tabs in the view
set uuid to pass to view-content.
#}
{% if exp_col_all %}
{% set uuid = random() %}
<div class="view-tabs">
......@@ -40,17 +43,11 @@
{{ attachment_before }}
</div>
{% endif %}
{# Pass uuid down if we have it #}
{% if rows %}
{% if exp_col_all %}
{# <div class="uw-exp-col-all" data-uuid="{{ uuid }}">#}
{% endif %}
{% include '@components/view/view-content/view-content.twig' with {
uuid:uuid,
} %}
{% if exp_col_all %}
{# </div>#}
{% endif %}
{% else %}
<div class="view-content--message">
<div role="alert" class="message message--warning">
......
......@@ -11,6 +11,7 @@ pager: 'Pager'
attachment_after: false
more: false
footer: true
rss_feed: true
feed_icons: false
title_prefix: 'false'
title_suffix: 'false'
......
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