MDL-69878 core_message: always show message drawer close icon
authorBas Brands <bas@moodle.com>
Wed, 28 Oct 2020 14:11:57 +0000 (15:11 +0100)
committerBas Brands <bas@moodle.com>
Wed, 11 Nov 2020 14:39:16 +0000 (15:39 +0100)
12 files changed:
message/amd/build/message_drawer.min.js
message/amd/build/message_drawer.min.js.map
message/amd/src/message_drawer.js
message/templates/message_drawer.mustache
message/templates/message_drawer_view_contacts_header.mustache
message/templates/message_drawer_view_conversation_header.mustache
message/templates/message_drawer_view_overview_header.mustache
message/templates/message_drawer_view_search_header.mustache
message/templates/message_drawer_view_settings_header.mustache
theme/boost/scss/moodle/drawer.scss
theme/boost/style/moodle.css
theme/classic/style/moodle.css

index bcb430f..e5ea5a0 100644 (file)
Binary files a/message/amd/build/message_drawer.min.js and b/message/amd/build/message_drawer.min.js differ
index fad7113..4c16845 100644 (file)
Binary files a/message/amd/build/message_drawer.min.js.map and b/message/amd/build/message_drawer.min.js.map differ
index c36f8b0..03a4866 100644 (file)
@@ -254,7 +254,7 @@ function(
         });
 
         $(SELECTORS.JUMPTO).focus(function() {
-            var firstInput = $(SELECTORS.HEADER_CONTAINER).find('input:visible');
+            var firstInput = root.find(SELECTORS.CLOSE_BUTTON);
             if (firstInput.length) {
                 firstInput.focus();
             } else {
@@ -298,6 +298,10 @@ function(
 
         var closebutton = root.find(SELECTORS.CLOSE_BUTTON);
         closebutton.on(CustomEvents.events.activate, function() {
+            var button = $(SELECTORS.DRAWER).attr('data-origin');
+            if (button) {
+                $('#' + button).focus();
+            }
             PubSub.publish(Events.TOGGLE_VISIBILITY);
         });
 
index 215cf15..c29d841 100644 (file)
@@ -36,8 +36,8 @@
 {{< core/drawer}}
     {{$drawercontent}}
         <div id="message-drawer-{{uniqid}}" class="message-app" data-region="message-drawer" role="region">
-            <div class="closewidget bg-light border-bottom text-right">
-                <a class="text-dark" data-action="closedrawer" href="#">
+            <div class="closewidget text-right pr-2">
+                <a class="text-dark btn-link" data-action="closedrawer" href="#">
                      {{#pix}} i/window_close, core, {{#str}} closebuttontitle {{/str}} {{/pix}}
                 </a>
             </div>
index cef660d..ff09a4b 100644 (file)
@@ -34,7 +34,7 @@
     {}
 
 }}
-<div class="hidden border-bottom px-2 py-3" aria-hidden="true" data-region="view-contacts">
+<div class="hidden border-bottom p-1 px-sm-2" aria-hidden="true" data-region="view-contacts">
     <div class="d-flex align-items-center">
         {{#isdrawer}}
         <div class="align-self-stretch">
index 8a2d001..4b38ef3 100644 (file)
@@ -35,7 +35,7 @@
 }}
 
 <div
-    class="hidden bg-white position-relative border-bottom p-1 p-sm-2"
+    class="hidden bg-white position-relative border-bottom p-1 px-sm-2"
     aria-hidden="true"
     data-region="view-conversation"
 >
index 07c801c..b633815 100644 (file)
@@ -33,7 +33,7 @@
     {}
 
 }}
-<div class="border-bottom  p-1 px-sm-2 py-sm-3" aria-hidden="false" {{^isdrawer}}data-in-panel="true"{{/isdrawer}} data-region="view-overview">
+<div class="border-bottom p-1 px-sm-2" aria-hidden="false" {{^isdrawer}}data-in-panel="true"{{/isdrawer}} data-region="view-overview">
     <div class="d-flex align-items-center">
         <div class="input-group simplesearchform">
             <input
index 296110b..8a270f8 100644 (file)
@@ -34,7 +34,7 @@
 
 }}
 
-<div class="hidden border-bottom px-2 py-3 view-search" {{^isdrawer}}data-in-panel="true"{{/isdrawer}} aria-hidden="true" data-region="view-search">
+<div class="hidden border-bottom p-1 px-sm-2 view-search" {{^isdrawer}}data-in-panel="true"{{/isdrawer}} aria-hidden="true" data-region="view-search">
     <div class="d-flex align-items-center">
         <a
             class="mr-2 align-self-stretch d-flex align-items-center"
index a9f717e..60f1eb4 100644 (file)
@@ -34,7 +34,7 @@
 
 }}
 
-<div class="hidden border-bottom px-2 py-3" aria-hidden="true" data-region="view-settings">
+<div class="hidden border-bottom p-1 px-sm-2 pb-sm-3" aria-hidden="true" data-region="view-settings">
     <div class="d-flex align-items-center">
         {{#isdrawer}}
         <div class="align-self-stretch" >
index d20a049..de68d00 100644 (file)
@@ -124,10 +124,6 @@ $right-drawer-width: 320px;
         opacity: 1;
     }
 
-    .closewidget {
-        display: none;
-    }
-
     &.hidden {
         display: block;
         right: $right-drawer-width * -1;
@@ -147,10 +143,6 @@ $right-drawer-width: 320px;
             height: 100%;
             z-index: $zindex-fixed;
         }
-        .closewidget {
-            display: block;
-            padding: 0 0.2rem;
-        }
     }
     body.drawer-open-left,
     body.drawer-open-right {
index 59f212a..bc4391e 100644 (file)
@@ -14170,8 +14170,6 @@ body.drawer-ease {
     padding: 0;
     visibility: visible;
     opacity: 1; }
-  [data-region=right-hand-drawer] .closewidget {
-    display: none; }
   [data-region=right-hand-drawer].hidden {
     display: block;
     right: -320px;
@@ -14187,9 +14185,6 @@ body.drawer-ease {
     top: 0;
     height: 100%;
     z-index: 1030; }
-  [data-region=right-hand-drawer] .closewidget {
-    display: block;
-    padding: 0 0.2rem; }
   body.drawer-open-left,
   body.drawer-open-right {
     overflow: hidden; } }
index cf7cc90..c470b58 100644 (file)
@@ -14385,8 +14385,6 @@ body.drawer-ease {
     padding: 0;
     visibility: visible;
     opacity: 1; }
-  [data-region=right-hand-drawer] .closewidget {
-    display: none; }
   [data-region=right-hand-drawer].hidden {
     display: block;
     right: -320px;
@@ -14402,9 +14400,6 @@ body.drawer-ease {
     top: 0;
     height: 100%;
     z-index: 1030; }
-  [data-region=right-hand-drawer] .closewidget {
-    display: block;
-    padding: 0 0.2rem; }
   body.drawer-open-left,
   body.drawer-open-right {
     overflow: hidden; } }