hide token configure menu when clicking outside it

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-12-06 15:43:37 +01:00
parent 4f6993a15e
commit ab993ad486
No known key found for this signature in database
GPG key ID: 425003AC385454C5

View file

@ -217,6 +217,10 @@
}));
var $el = $(el);
$('body').on('click', _.bind(_this._hideConfigureToken, _this));
$el.on('click', '.popovermenu', function(event) {
event.stopPropagation();
});
$el.on('click', 'a.icon-delete', _.bind(_this._onDeleteToken, _this));
$el.on('click', '.icon-more', _.bind(_this._onConfigureToken, _this));
$el.on('change', 'input.filesystem', _.bind(_this._onSetTokenScope, _this));
@ -355,13 +359,18 @@
},
_onConfigureToken: function (event) {
event.stopPropagation();
this._hideConfigureToken();
var $target = $(event.target);
var $row = $target.closest('tr');
$('.token-list tr').removeClass('active');
$row.toggleClass('active');
var id = $row.data('id');
},
_hideConfigureToken: function() {
$('.token-list tr').removeClass('active');
},
_onDeleteToken: function (event) {
var $target = $(event.target);
var $row = $target.closest('tr');