From e27c2d77a9bcc8492391623329c21e694baa2420 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 24 Jul 2017 16:35:16 -0300 Subject: [PATCH 1/3] Closes tab bar on mobile when leaving room --- packages/rocketchat-lib/client/lib/roomExit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/rocketchat-lib/client/lib/roomExit.js b/packages/rocketchat-lib/client/lib/roomExit.js index 36f1260e3420..646b5fdcf2f0 100644 --- a/packages/rocketchat-lib/client/lib/roomExit.js +++ b/packages/rocketchat-lib/client/lib/roomExit.js @@ -1,5 +1,10 @@ /*globals currentTracker */ this.roomExit = function() { + // 7370 - Close flex-tab when opening a room on mobile UI + if (window.matchMedia('(max-width: 500px)').matches) { + const templateData = Blaze.getData(document.querySelector('.flex-tab')); + templateData && templateData.tabBar && templateData.tabBar.close(); + } RocketChat.callbacks.run('roomExit'); BlazeLayout.render('main', { center: 'none' From d69230965cb86522deaa4452fde48d42f74e0ca0 Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Mon, 24 Jul 2017 18:45:43 -0300 Subject: [PATCH 2/3] Closes tabbar when going to message from search result --- packages/rocketchat-ui-flextab/client/tabs/messageSearch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js index 78e627c8a9de..b7bc6cde076e 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js +++ b/packages/rocketchat-ui-flextab/client/tabs/messageSearch.js @@ -9,6 +9,9 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; RocketChat.MessageAction.hideDropDown(); + if (window.matchMedia('(max-width: 500px)').matches) { + Template.instance().tabBar.close(); + } return RoomHistoryManager.getSurroundingMessages(message, 50); }, order: 100 From 4a8ea9ce1f81383c0f3f29dcdf25628b8f1850cc Mon Sep 17 00:00:00 2001 From: Gabriel Delavald Date: Tue, 25 Jul 2017 15:44:33 -0300 Subject: [PATCH 3/3] Adds feature to all jump-to-message actions --- packages/rocketchat-mentions-flextab/client/actionButton.js | 3 +++ packages/rocketchat-message-pin/client/actionButton.js | 3 +++ packages/rocketchat-message-star/client/actionButton.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/packages/rocketchat-mentions-flextab/client/actionButton.js b/packages/rocketchat-mentions-flextab/client/actionButton.js index 9f2335693637..9061f8711740 100644 --- a/packages/rocketchat-mentions-flextab/client/actionButton.js +++ b/packages/rocketchat-mentions-flextab/client/actionButton.js @@ -7,6 +7,9 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; RocketChat.MessageAction.hideDropDown(); + if (window.matchMedia('(max-width: 500px)').matches) { + Template.instance().tabBar.close(); + } return RoomHistoryManager.getSurroundingMessages(message, 50); }, validation(message) { diff --git a/packages/rocketchat-message-pin/client/actionButton.js b/packages/rocketchat-message-pin/client/actionButton.js index 5e77c3fb7308..c76f6ea0f1ac 100644 --- a/packages/rocketchat-message-pin/client/actionButton.js +++ b/packages/rocketchat-message-pin/client/actionButton.js @@ -62,6 +62,9 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; RocketChat.MessageAction.hideDropDown(); + if (window.matchMedia('(max-width: 500px)').matches) { + Template.instance().tabBar.close(); + } return RoomHistoryManager.getSurroundingMessages(message, 50); }, validation(message) { diff --git a/packages/rocketchat-message-star/client/actionButton.js b/packages/rocketchat-message-star/client/actionButton.js index cbcbc64f1522..31d8818bbdc7 100644 --- a/packages/rocketchat-message-star/client/actionButton.js +++ b/packages/rocketchat-message-star/client/actionButton.js @@ -54,6 +54,9 @@ Meteor.startup(function() { action() { const message = this._arguments[1]; RocketChat.MessageAction.hideDropDown(); + if (window.matchMedia('(max-width: 500px)').matches) { + Template.instance().tabBar.close(); + } return RoomHistoryManager.getSurroundingMessages(message, 50); }, validation(message) {