Skip to content

Commit 488b9e0

Browse files
Add expand feature to notification drawer
1 parent ec21029 commit 488b9e0

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

less/notifications-drawer.less

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@
4141
cursor: pointer;
4242
display: block;
4343
}
44+
&.drawer-pf-expanded {
45+
left: 270px;
46+
width: inherit;
47+
.drawer-pf-toggle-expand:before {
48+
content: "\f101";
49+
}
50+
}
51+
}
52+
.drawer-pf-toggle-expand {
53+
color: inherit;
54+
cursor: pointer;
55+
left: 0;
56+
padding: 2px 5px;
57+
position: absolute;
58+
&:before {
59+
content: "\f100";
60+
font-family: "FontAwesome";
61+
}
62+
&:hover,
63+
&:focus {
64+
color: inherit;
65+
text-decoration: none;
66+
}
4467
}
4568

4669
.drawer-pf-action {
@@ -77,13 +100,22 @@
77100
}
78101
&:hover { background-color: @color-pf-blue-50; }
79102
&.unread .drawer-pf-notification-message { font-weight: bold; }
103+
&.expanded-notification {
104+
.date {
105+
border-right: none;
106+
padding-right: 0;
107+
}
108+
}
80109
}
81110

82111
.drawer-pf-notification-info,
83112
.drawer-pf-notification-message {
84113
display: block;
85114
padding-left: 27px;
86115
padding-right: 19px;
116+
.expanded-notification & {
117+
display: inline-block;
118+
}
87119
}
88120

89121
.drawer-pf-notifications-non-clickable .drawer-pf-notification:hover {
@@ -128,4 +160,4 @@
128160
top: 26px;
129161
}
130162
.drawer-pf-trigger-icon { cursor: pointer; }
131-
}
163+
}

tests/pages/_includes/widgets/notification-drawer.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="drawer-pf hide drawer-pf-notifications-non-clickable">
22
<div class="drawer-pf-title">
3+
<a class="drawer-pf-toggle-expand"></a>
34
<h3 class="text-center">Notifications Drawer</h3>
45
</div>
56
<div class="panel-group" id="notification-drawer-accordion">
@@ -88,6 +89,19 @@ <h4 class="panel-title">
8889
$drawer.addClass('hide');
8990
}
9091
});
92+
$('.drawer-pf-toggle-expand').click(function() {
93+
var $drawer = $('.drawer-pf');
94+
var $drawerNotifications = $drawer.find('.drawer-pf-notification');
95+
96+
if ($drawer.hasClass('drawer-pf-expanded')) {
97+
$drawer.removeClass('drawer-pf-expanded');
98+
$drawerNotifications.removeClass('expanded-notification');
99+
} else {
100+
$drawer.addClass('drawer-pf-expanded');
101+
$drawerNotifications.addClass('expanded-notification');
102+
}
103+
});
104+
91105
// Mark All Read
92106
$('.panel-collapse').each(function (index, panel) {
93107
var $panel = $(panel);
@@ -99,4 +113,4 @@ <h4 class="panel-title">
99113

100114
$('#notification-drawer-accordion').initCollapseHeights('.panel-body');
101115
});
102-
</script>
116+
</script>

0 commit comments

Comments
 (0)