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
1 changed files with 2 additions and 2 deletions

View File

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