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';
import Profile from '~/profile/profile';
import initSearchSettings from '~/search_settings';
// eslint-disable-next-line func-names
$(document).on('input.ssh_key', '#key_key', function () {
const $title = $('#key_title');
const comment = $(this)
.val()
.match(/^\S+ \S+ (.+)\n?$/);
document.addEventListener('DOMContentLoaded', () => {
// eslint-disable-next-line func-names
$(document).on('input.ssh_key', '#key_key', function () {
const $title = $('#key_title');
const comment = $(this)
.val()
.match(/^\S+ \S+ (.+)\n?$/);
// Extract the SSH Key title from its comment
if (comment && comment.length > 1) {
$title.val(comment[1]).change();
}
});
// Extract the SSH Key title from its comment
if (comment && comment.length > 1) {
$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 }) =>
ref: 'searchSettings',
props: {
searchRoot: document.querySelector('#content-body'),
sectionSelector: 'section.settings',
sectionSelector: '.js-search-settings-section, section.settings',
},
on: {
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