diff --git a/core/modules/user/src/Form/UserPermissionsForm.php b/core/modules/user/src/Form/UserPermissionsForm.php index 9a1df99..4f5b8ef 100644 --- a/core/modules/user/src/Form/UserPermissionsForm.php +++ b/core/modules/user/src/Form/UserPermissionsForm.php @@ -140,7 +140,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $options[$perm] = $perm_item['title']; $form['permissions'][$perm]['description'] = array( '#type' => 'inline_template', - '#template' => '
', + '#template' => ' ', '#context' => array( 'title' => $perm_item['title'], ), diff --git a/core/modules/user/user.permissions.js b/core/modules/user/user.permissions.js index 415fc53..7d71cf6 100644 --- a/core/modules/user/user.permissions.js +++ b/core/modules/user/user.permissions.js @@ -49,6 +49,55 @@ // Re-insert the table into the DOM. $ancestor[method]($table); }); + + var $input = $('input.table-filter-text').once('table-filter-text'); + var $table = $($input.attr('data-table')); + var $rowsAndDetails, $rows, $details; + var searching = false; + + function filterPermissionList(e) { + var query = $(e.target).val().toLowerCase(); + + function showPermissionRow(index, row) { + var $row = $(row); + var $sources = $row.find('.table-filter-text-source'); + var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1; + $row.closest('tr').toggle(textMatch); + } + // Search over all rows and packages. + $rowsAndDetails.show(); + + // Filter if the length of the query is at least 2 characters. + if (query.length >= 2) { + searching = true; + $rows.each(showPermissionRow); + + // Note that we first open all