Revert "FIX: reverts #18e2816 (#7940)"

Revert “FIX: reverts #18e2816 (#7940)”

This reverts commit c7b146cbdfda41494c350a58982d2fe54893d2c1.

diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6
index c1983bc..d4ef29a 100644
--- a/app/assets/javascripts/discourse/controllers/topic.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic.js.es6
@@ -722,6 +722,11 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
       this._jumpToPostId(postId);
     },
 
+    hideMultiSelect() {
+      this.set("multiSelect", false);
+      this._forceRefreshPostStream();
+    },
+
     toggleMultiSelect() {
       this.toggleProperty("multiSelect");
       this._forceRefreshPostStream();
diff --git a/app/assets/javascripts/discourse/templates/components/topic-footer-buttons.hbs b/app/assets/javascripts/discourse/templates/components/topic-footer-buttons.hbs
index 6347270..15fbecd 100644
--- a/app/assets/javascripts/discourse/templates/components/topic-footer-buttons.hbs
+++ b/app/assets/javascripts/discourse/templates/components/topic-footer-buttons.hbs
@@ -4,6 +4,7 @@
       topic=topic
       openUpwards="true"
       toggleMultiSelect=toggleMultiSelect
+      hideMultiSelect=hideMultiSelect
       deleteTopic=deleteTopic
       recoverTopic=recoverTopic
       toggleClosed=toggleClosed
diff --git a/app/assets/javascripts/discourse/templates/topic.hbs b/app/assets/javascripts/discourse/templates/topic.hbs
index f8e5ee3..afbfb72 100644
--- a/app/assets/javascripts/discourse/templates/topic.hbs
+++ b/app/assets/javascripts/discourse/templates/topic.hbs
@@ -95,6 +95,7 @@
                 topic=model
                 fixed="true"
                 toggleMultiSelect=(action "toggleMultiSelect")
+                hideMultiSelect=(action "hideMultiSelect")
                 deleteTopic=(action "deleteTopic")
                 recoverTopic=(action "recoverTopic")
                 toggleClosed=(action "toggleClosed")
@@ -122,6 +123,7 @@
               jumpToIndex=(action "jumpToIndex")
               replyToPost=(action "replyToPost")
               toggleMultiSelect=(action "toggleMultiSelect")
+              hideMultiSelect=(action "hideMultiSelect")
               deleteTopic=(action "deleteTopic")
               recoverTopic=(action "recoverTopic")
               toggleClosed=(action "toggleClosed")
@@ -145,6 +147,7 @@
                   openUpwards="true"
                   rightSide="true"
                   toggleMultiSelect=(action "toggleMultiSelect")
+                  hideMultiSelect=(action "hideMultiSelect")
                   deleteTopic=(action "deleteTopic")
                   recoverTopic=(action "recoverTopic")
                   toggleClosed=(action "toggleClosed")
@@ -291,6 +294,7 @@
                     {{topic-footer-buttons
                       topic=model
                       toggleMultiSelect=(action "toggleMultiSelect")
+                      hideMultiSelect=(action "hideMultiSelect")
                       deleteTopic=(action "deleteTopic")
                       recoverTopic=(action "recoverTopic")
                       toggleClosed=(action "toggleClosed")
diff --git a/app/assets/javascripts/discourse/widgets/topic-admin-menu.js.es6 b/app/assets/javascripts/discourse/widgets/topic-admin-menu.js.es6
index ccc5a82..466cd7a 100644
--- a/app/assets/javascripts/discourse/widgets/topic-admin-menu.js.es6
+++ b/app/assets/javascripts/discourse/widgets/topic-admin-menu.js.es6
@@ -90,6 +90,7 @@ createWidget("topic-admin-menu-button", {
       position.left += $button.width() - 203;
     }
     this.state.position = position;
+    this.sendWidgetAction("hideMultiSelect");
   }
 });
 
diff --git a/test/javascripts/acceptance/topic-test.js.es6 b/test/javascripts/acceptance/topic-test.js.es6
index d856cc9..3a3b6de 100644
--- a/test/javascripts/acceptance/topic-test.js.es6
+++ b/test/javascripts/acceptance/topic-test.js.es6
@@ -255,6 +255,13 @@ QUnit.test("selecting posts", async assert => {
     exists(".select-all"),
     "it should allow users to select all the posts"
   );
+
+  await click(".toggle-admin-menu");
+
+  assert.ok(
+    exists(".selected-posts.hidden"),
+    "it should hide the multi select menu"
+  );
 });
 
 QUnit.test("select below", async assert => {

GitHub sha: c7516c42

Revert commit that was pushed by mistake.