Commit 177a6c47 authored by Enrique Alcantara's avatar Enrique Alcantara

Add new search specific section selector

parent 11c0e896
...@@ -3,19 +3,21 @@ import '~/profile/gl_crop'; ...@@ -3,19 +3,21 @@ import '~/profile/gl_crop';
import Profile from '~/profile/profile'; import Profile from '~/profile/profile';
import initSearchSettings from '~/search_settings'; import initSearchSettings from '~/search_settings';
// eslint-disable-next-line func-names document.addEventListener('DOMContentLoaded', () => {
$(document).on('input.ssh_key', '#key_key', function () { // eslint-disable-next-line func-names
const $title = $('#key_title'); $(document).on('input.ssh_key', '#key_key', function () {
const comment = $(this) const $title = $('#key_title');
.val() const comment = $(this)
.match(/^\S+ \S+ (.+)\n?$/); .val()
.match(/^\S+ \S+ (.+)\n?$/);
// Extract the SSH Key title from its comment // Extract the SSH Key title from its comment
if (comment && comment.length > 1) { if (comment && comment.length > 1) {
$title.val(comment[1]).change(); $title.val(comment[1]).change();
} }
}); });
new Profile(); // eslint-disable-line no-new new Profile(); // eslint-disable-line no-new
initSearchSettings(); initSearchSettings();
});
...@@ -11,7 +11,7 @@ const mountSearch = ({ el }) => ...@@ -11,7 +11,7 @@ const mountSearch = ({ el }) =>
ref: 'searchSettings', ref: 'searchSettings',
props: { props: {
searchRoot: document.querySelector('#content-body'), searchRoot: document.querySelector('#content-body'),
sectionSelector: 'section.settings', sectionSelector: '.js-search-settings-section, section.settings',
}, },
on: { on: {
collapse: (section) => closeSection($(section)), collapse: (section) => closeSection($(section)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment