Skip to content
This repository was archived by the owner on Jan 12, 2018. It is now read-only.

Commit c9135f2

Browse files
authored
Merge pull request #147 from skateman/convert-3.21
Converted from upstream version 3.21.0
2 parents a92b4ce + eae032b commit c9135f2

95 files changed

Lines changed: 610 additions & 118 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/javascripts/patternfly-functions.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,3 +1142,83 @@
11421142
return $.fn.setupVerticalNavigation.self;
11431143
};
11441144
}(jQuery));
1145+
1146+
// PatternFly pf-list
1147+
(function ($) {
1148+
'use strict';
1149+
1150+
$.fn.pfList = function () {
1151+
function init (list) {
1152+
// Ensure the state of the expansion elements is consistent
1153+
list.find('[data-list=expansion], .list-pf-item, .list-pf-expansion').each(function (index, element) {
1154+
var $expansion = $(element),
1155+
$collapse = $expansion.find('.collapse').first(),
1156+
expanded = $collapse.hasClass('in');
1157+
updateChevron($expansion, expanded);
1158+
if ($expansion.hasClass('list-pf-item')) {
1159+
updateActive($expansion, expanded);
1160+
}
1161+
});
1162+
list.find('.list-pf-container').each(function (index, element) {
1163+
var $element = $(element);
1164+
// The toggle element is the element with the data-list=toggle attribute
1165+
// or the entire .list-pf-container as a fallback
1166+
var $toggles = $element.find('[data-list=toggle]');
1167+
$toggles.length || ($toggles = $element);
1168+
$toggles.on('keydown', function (event) {
1169+
if (event.keyCode === 13 || event.keyCode === 32) {
1170+
toggleCollapse(this);
1171+
event.stopPropagation();
1172+
event.preventDefault();
1173+
}
1174+
});
1175+
$toggles.on('click', function (event) {
1176+
toggleCollapse(this);
1177+
event.stopPropagation();
1178+
event.preventDefault();
1179+
});
1180+
});
1181+
}
1182+
1183+
function toggleCollapse (toggle) {
1184+
var $toggle, $expansion, $collapse, expanded, $listItem;
1185+
$toggle = $(toggle);
1186+
// Find the parent expansion of the toggle
1187+
$expansion = $toggle.parentsUntil('.list-pf', '[data-list=expansion]').first();
1188+
$expansion.length || ($expansion = $toggle.closest('.list-pf-item, .list-pf-expansion'));
1189+
1190+
// toggle the "in" class of its first .collapse child
1191+
$collapse = $expansion.find('.collapse').first();
1192+
$collapse.toggleClass('in');
1193+
1194+
// update the state of the expansion element
1195+
updateChevron($expansion, $collapse.hasClass('in'));
1196+
$listItem = $expansion.closest('.list-pf-item');
1197+
updateActive($listItem, $listItem.find('.collapse').first().hasClass('in'));
1198+
}
1199+
1200+
function updateActive ($listItem, expanded) {
1201+
// Find the closest .list-pf-item of the expansion, and set its "active" class
1202+
if (expanded) {
1203+
$listItem.addClass('active');
1204+
} else {
1205+
$listItem.removeClass('active');
1206+
}
1207+
}
1208+
1209+
function updateChevron ($expansion, expanded) {
1210+
var $chevron = $expansion.find('.list-pf-chevron .fa').first();
1211+
if (expanded) {
1212+
$chevron.removeClass('fa-angle-right');
1213+
$chevron.addClass('fa-angle-down');
1214+
} else {
1215+
$chevron.addClass('fa-angle-right');
1216+
$chevron.removeClass('fa-angle-down');
1217+
}
1218+
}
1219+
1220+
init(this);
1221+
1222+
return this;
1223+
};
1224+
}(jQuery));

assets/javascripts/patternfly-functions.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/javascripts/patternfly-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
var patternfly = {
5-
version: "3.20.0",
5+
version: "3.21.0",
66
};
77

88
// Util: PatternFly Palette colors

assets/javascripts/patternfly-settings.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/javascripts/patternfly.js

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
var patternfly = {
5-
version: "3.20.0",
5+
version: "3.21.0",
66
};
77

88
// Util: PatternFly Palette colors
@@ -1663,3 +1663,83 @@
16631663
return $.fn.setupVerticalNavigation.self;
16641664
};
16651665
}(jQuery));
1666+
1667+
// PatternFly pf-list
1668+
(function ($) {
1669+
'use strict';
1670+
1671+
$.fn.pfList = function () {
1672+
function init (list) {
1673+
// Ensure the state of the expansion elements is consistent
1674+
list.find('[data-list=expansion], .list-pf-item, .list-pf-expansion').each(function (index, element) {
1675+
var $expansion = $(element),
1676+
$collapse = $expansion.find('.collapse').first(),
1677+
expanded = $collapse.hasClass('in');
1678+
updateChevron($expansion, expanded);
1679+
if ($expansion.hasClass('list-pf-item')) {
1680+
updateActive($expansion, expanded);
1681+
}
1682+
});
1683+
list.find('.list-pf-container').each(function (index, element) {
1684+
var $element = $(element);
1685+
// The toggle element is the element with the data-list=toggle attribute
1686+
// or the entire .list-pf-container as a fallback
1687+
var $toggles = $element.find('[data-list=toggle]');
1688+
$toggles.length || ($toggles = $element);
1689+
$toggles.on('keydown', function (event) {
1690+
if (event.keyCode === 13 || event.keyCode === 32) {
1691+
toggleCollapse(this);
1692+
event.stopPropagation();
1693+
event.preventDefault();
1694+
}
1695+
});
1696+
$toggles.on('click', function (event) {
1697+
toggleCollapse(this);
1698+
event.stopPropagation();
1699+
event.preventDefault();
1700+
});
1701+
});
1702+
}
1703+
1704+
function toggleCollapse (toggle) {
1705+
var $toggle, $expansion, $collapse, expanded, $listItem;
1706+
$toggle = $(toggle);
1707+
// Find the parent expansion of the toggle
1708+
$expansion = $toggle.parentsUntil('.list-pf', '[data-list=expansion]').first();
1709+
$expansion.length || ($expansion = $toggle.closest('.list-pf-item, .list-pf-expansion'));
1710+
1711+
// toggle the "in" class of its first .collapse child
1712+
$collapse = $expansion.find('.collapse').first();
1713+
$collapse.toggleClass('in');
1714+
1715+
// update the state of the expansion element
1716+
updateChevron($expansion, $collapse.hasClass('in'));
1717+
$listItem = $expansion.closest('.list-pf-item');
1718+
updateActive($listItem, $listItem.find('.collapse').first().hasClass('in'));
1719+
}
1720+
1721+
function updateActive ($listItem, expanded) {
1722+
// Find the closest .list-pf-item of the expansion, and set its "active" class
1723+
if (expanded) {
1724+
$listItem.addClass('active');
1725+
} else {
1726+
$listItem.removeClass('active');
1727+
}
1728+
}
1729+
1730+
function updateChevron ($expansion, expanded) {
1731+
var $chevron = $expansion.find('.list-pf-chevron .fa').first();
1732+
if (expanded) {
1733+
$chevron.removeClass('fa-angle-right');
1734+
$chevron.addClass('fa-angle-down');
1735+
} else {
1736+
$chevron.addClass('fa-angle-right');
1737+
$chevron.removeClass('fa-angle-down');
1738+
}
1739+
}
1740+
1741+
init(this);
1742+
1743+
return this;
1744+
};
1745+
}(jQuery));

assets/javascripts/patternfly.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/stylesheets/_patternfly.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
@import "patternfly/infotip";
8888
@import "patternfly/layouts";
8989
@import "patternfly/links";
90+
@import "patternfly/list-pf";
9091
@import "patternfly/list-view";
9192
@import "patternfly/list-view-dnd";
9293
@import "patternfly/login";

assets/stylesheets/patternfly/_alerts.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
padding-left: 47px;
88
padding-right: ($alert-padding + 3);
99
position: relative;
10+
word-wrap: break-word;
1011
.alert-link {
1112
color: $link-color;
1213
&:hover {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// PatternFly List
3+
// --------------------------------------------------
4+
5+
.list-pf {
6+
border-bottom: 1px solid $list-pf-border-color;
7+
}
8+
9+
.list-pf-item {
10+
border-color: $list-pf-border-color;
11+
border-left-color: #fff;
12+
border-right-color: #fff;
13+
border-style: solid;
14+
border-width: 1px;
15+
border-bottom: none;
16+
&:hover {
17+
background-color: $list-pf-hover-background-color;
18+
}
19+
&.active {
20+
background-color: $list-pf-header-background-color;
21+
border-color: $list-pf-active-border-color;
22+
border-bottom-width: 1px;
23+
border-bottom-style: solid;
24+
}
25+
}
26+
27+
.list-pf-expansion {
28+
background-color: #fff;
29+
}
30+
31+
.list-pf-container {
32+
align-items: center;
33+
display: flex;
34+
padding: $list-pf-padding;
35+
.list-pf-expansion & {
36+
border-top: 1px solid $list-pf-active-border-color;
37+
}
38+
}
39+
40+
.list-pf-chevron {
41+
margin-right: 5px;
42+
+ .list-pf-content {
43+
border-left: 1px solid $list-pf-active-border-color;
44+
padding-left: 15px;
45+
}
46+
.fa {
47+
font-size: 22px;
48+
width: 20px;
49+
}
50+
}

assets/stylesheets/patternfly/_variables.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ $img-spinner-sm: "spinner-sm.
5050
$img-spinner-xs: "spinner-xs.gif" !default;
5151
$input-border-hover: $color-pf-blue-200 !default;
5252
$input-border-focus: $color-pf-blue-400 !default;
53+
$list-pf-border-color: $color-pf-black-200 !default;
54+
$list-pf-active-border-color: $color-pf-black-400 !default;
55+
$list-pf-header-background-color: $color-pf-black-200 !default;
56+
$list-pf-hover-background-color: $color-pf-black-100 !default;
57+
$list-pf-padding: 20px !default;
5358
$list-view-accented-border: $color-pf-blue-300 !default;
5459
$list-view-active-bg: $color-pf-blue-50 !default;
5560
$list-view-divider: $color-pf-black-300 !default;

0 commit comments

Comments
 (0)