FIX: Touch events conflicted on mobile safari with {{action}}s, preventing admin menu

option from working. Mobile Safari works with click so this seems to fix it.
This commit is contained in:
Robin Ward 2013-06-06 13:16:36 -04:00
parent 06e83c9e6a
commit 526f2af69a

View File

@ -9,12 +9,12 @@
Discourse.TopicAdminMenuView = Discourse.View.extend({
willDestroyElement: function() {
$('html').off('mouseup.discourse-topic-admin-menu touchend.discourse-topic-admin-menu');
$('html').off('mouseup.discourse-topic-admin-menu');
},
didInsertElement: function() {
var topicAdminMenuView = this;
return $('html').on('mouseup.discourse-topic-admin-menu touchend.discourse-topic-admin-menu', function(e) {
$('html').on('mouseup.discourse-topic-admin-menu', function(e) {
var $target = $(e.target);
if ($target.is('button') || topicAdminMenuView.$().has($target).length === 0) {
topicAdminMenuView.get('controller').hide();