mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
27 lines
615 B
JavaScript
27 lines
615 B
JavaScript
/**
|
|
This view is used for rendering the topic admin menu
|
|
|
|
@class TopicAdminMenuView
|
|
@extends Discourse.View
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
Discourse.TopicAdminMenuView = 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');
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
|