This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/topic-admin-menu.js.es6
2014-06-16 15:55:09 -04:00

28 lines
599 B
JavaScript

/**
This view is used for rendering the topic admin menu
@class TopicAdminMenuView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
export default Discourse.View.extend({
willDestroyElement: function() {
$('html').off('mouseup.discourse-topic-admin-menu');
},
didInsertElement: function() {
var self = this;
$('html').on('mouseup.discourse-topic-admin-menu', function(e) {
var $target = $(e.target);
if ($target.is('button') || self.$().has($target).length === 0) {
self.get('controller').send('hide');
}
});
}
});