diff options
author | binsky <timo@binsky.org> | 2021-03-17 02:56:22 +0300 |
---|---|---|
committer | binsky <timo@binsky.org> | 2021-03-17 02:56:22 +0300 |
commit | 5f439862d5a96b5f5e8406e68b6814230a2d471a (patch) | |
tree | 15a89d4e9a498104708a03d3c92ccac5e19dc394 /js | |
parent | 22fe2fc7544e3a1706e2e7479d513391ba6d760c (diff) |
fix vaults mover
Diffstat (limited to 'js')
-rw-r--r-- | js/settings-admin.js | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/js/settings-admin.js b/js/settings-admin.js index b607e161..50146b07 100644 --- a/js/settings-admin.js +++ b/js/settings-admin.js @@ -137,16 +137,38 @@ $(document).ready(function () { 'source_account': '', 'destination_account': '' }; - $(".username-autocomplete").autocomplete({ - source: OC.generateUrl('apps/passman/admin/search'), - minLength: 1, - select: function (event, ui) { - accountMover[$(this).attr('id')] = ui.item.value; - } + $('.account_mover_selector').select2({ + ajax: { + url: OC.generateUrl('apps/passman/admin/search'), + dataType: 'json', + delay: 50, + data: function (param) { + return { + term: param + }; + }, + results: function (data) { + var res = []; + for (var i = 0; i < data.length; i++) { + res.push({ + id: i, + text: data[i].value + }); + } + return { + results: res + }; + }, + cache: true + }, + placeholder: 'Search for a user', + minimumInputLength: 1 }); $('#move_credentials').click(function () { var self = this; + accountMover.source_account = $('#s2id_source_account a .select2-chosen').html(); + accountMover.destination_account = $('#s2id_destination_account a .select2-chosen').html(); $('#moveStatus').hide(); $(self).attr('disabled', 'disabled'); $(self).html('<i class="fa fa-spinner fa-spin"></i> ' + OC.L10N.translate('passman', 'Moving') + '...'); |