From bdca804796b1c7cebcfb40cbe698f5e83f2f4dca Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 13 May 2013 15:29:16 -0400 Subject: [PATCH] Add a touchend event to the admin menu. Hopefully helps IE11 Touch. --- .../discourse/views/topic_admin_menu_view.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/views/topic_admin_menu_view.js b/app/assets/javascripts/discourse/views/topic_admin_menu_view.js index ebe64b0483a..56c65504631 100644 --- a/app/assets/javascripts/discourse/views/topic_admin_menu_view.js +++ b/app/assets/javascripts/discourse/views/topic_admin_menu_view.js @@ -9,16 +9,15 @@ Discourse.TopicAdminMenuView = Discourse.View.extend({ willDestroyElement: function() { - $('html').off('mouseup.discourse-topic-admin-menu'); + $('html').off('mouseup.discourse-topic-admin-menu touchend.discourse-topic-admin-menu'); }, didInsertElement: function() { - var _this = this; - return $('html').on('mouseup.discourse-topic-admin-menu', function(e) { - var $target; - $target = $(e.target); - if ($target.is('button') || _this.$().has($target).length === 0) { - return _this.get('controller').hide(); + var topicAdminMenuView = this; + return $('html').on('mouseup.discourse-topic-admin-menu touchend.discourse-topic-admin-menu', function(e) { + var $target = $(e.target); + if ($target.is('button') || topicAdminMenuView.$().has($target).length === 0) { + topicAdminMenuView.get('controller').hide(); } }); }