Browse Source

hide token configure menu when clicking outside it

Signed-off-by: Robin Appelman <robin@icewind.nl>
tags/v11.0RC2
Robin Appelman 7 years ago
parent
commit
ab993ad486
No account linked to committer's email address
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      settings/js/authtoken_view.js

+ 10
- 1
settings/js/authtoken_view.js 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');

Loading…
Cancel
Save