Skip to content

Commit 22ecbc3

Browse files
committed
Merge branch 'MDL-64195-36' of git://github.com/bmbrands/moodle into MOODLE_36_STABLE
2 parents b861e09 + b23aa51 commit 22ecbc3

File tree

3 files changed

+50
-14
lines changed

3 files changed

+50
-14
lines changed

theme/bootstrapbase/less/moodle/message.less

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,22 +1182,35 @@
11821182

11831183
.message-drawer {
11841184
position: fixed;
1185-
top: 0;
1186-
height: 100%;
11871185
right: 0;
11881186
width: @message-drawer-width;
11891187
z-index: 999;
11901188
background-color: @white;
11911189
box-shadow: -2px 2px 4px rgba(0, 0, 0, .08);
11921190
display: flex;
11931191
flex-direction: column;
1194-
1192+
height: ~"calc(100% - 42px)";
1193+
top: 52px;
1194+
.drawer-top {
1195+
transition: all .2s ease-in-out;
1196+
height: 0;
1197+
opacity: 0;
1198+
}
1199+
@media (max-width: 980px) {
1200+
&.affix {
1201+
top: 0;
1202+
height: 100%;
1203+
.drawer-top {
1204+
height: 37px;
1205+
opacity: 1;
1206+
}
1207+
}
1208+
}
11951209
@media (min-width: 980px) {
1210+
top: 42px;
11961211
.drawer-top {
11971212
display: none;
11981213
}
1199-
height: ~"calc(100% - 42px)";
1200-
top: 42px;
12011214
}
12021215

12031216
.transition(all .2s ease-in-out);

theme/bootstrapbase/style/moodle.css

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9107,23 +9107,37 @@ a.ygtvspacer:hover {
91079107
}
91089108
.message-drawer {
91099109
position: fixed;
9110-
top: 0;
9111-
height: 100%;
91129110
right: 0;
91139111
width: 320px;
91149112
z-index: 999;
91159113
background-color: #fff;
91169114
box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.08);
91179115
display: flex;
91189116
flex-direction: column;
9117+
height: calc(100% - 42px);
9118+
top: 52px;
91199119
-webkit-transition: all 0.2s ease-in-out;
91209120
-moz-transition: all 0.2s ease-in-out;
91219121
-o-transition: all 0.2s ease-in-out;
91229122
transition: all 0.2s ease-in-out;
91239123
}
9124+
.message-drawer .drawer-top {
9125+
transition: all 0.2s ease-in-out;
9126+
height: 0;
9127+
opacity: 0;
9128+
}
9129+
@media (max-width: 980px) {
9130+
.message-drawer.affix {
9131+
top: 0;
9132+
height: 100%;
9133+
}
9134+
.message-drawer.affix .drawer-top {
9135+
height: 37px;
9136+
opacity: 1;
9137+
}
9138+
}
91249139
@media (min-width: 980px) {
91259140
.message-drawer {
9126-
height: calc(100% - 42px);
91279141
top: 42px;
91289142
}
91299143
.message-drawer .drawer-top {

theme/bootstrapbase/templates/core_message/message_drawer.mustache

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@
4545
data-region="message-drawer"
4646
role="region"
4747
>
48-
<div class="drawer-top p-2 border-bottom bg-secondary text-right">
49-
<a id="message-drawer-close-{{uniqid}}" class="" href="#" role="button">
50-
{{#pix}} i/window_close, core, {{#str}} togglemessagemenu, message {{/str}} {{/pix}}
51-
</a>
48+
<div class="drawer-top border-bottom bg-secondary text-right">
49+
<div class="p-2">
50+
<a id="message-drawer-close-{{uniqid}}" href="#">
51+
{{#pix}} i/window_close, core, {{#str}} togglemessagemenu, message {{/str}} {{/pix}}
52+
</a>
53+
</div>
5254
</div>
5355
<div class="header-container position-relative" data-region="header-container">
5456
{{> core_message/message_drawer_view_contacts_header }}
@@ -76,16 +78,23 @@ require(
7678
[
7779
'jquery',
7880
'core_message/message_drawer',
79-
'core_message/message_popover'
81+
'core_message/message_popover',
82+
'theme_bootstrapbase/bootstrap'
8083
],
8184
function(
8285
$,
8386
MessageDrawer,
84-
Popover
87+
Popover,
88+
_
8589
) {
8690
8791
var root = $('#message-drawer-{{uniqid}}');
8892
MessageDrawer.init(root);
93+
root.affix({
94+
offset: {
95+
top: 52
96+
}
97+
});
8998

9099
var toggle = $('#message-drawer-close-{{uniqid}}');
91100
Popover.init(toggle);

0 commit comments

Comments
 (0)