debian-mirror-gitlab/app/assets/javascripts/pages/admin/admin.js

21 lines
656 B
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2022-06-21 17:19:12 +05:30
import { refreshCurrentPage } from '~/lib/utils/url_utility';
2018-03-17 18:26:18 +05:30
export default function adminInit() {
$('input#user_force_random_password').on('change', function randomPasswordClick() {
const $elems = $('#user_password, #user_password_confirmation');
if ($(this).attr('checked')) {
2018-03-27 19:54:05 +05:30
$elems.val('').prop('disabled', true);
2018-03-17 18:26:18 +05:30
} else {
2018-03-27 19:54:05 +05:30
$elems.prop('disabled', false);
2018-03-17 18:26:18 +05:30
}
});
2021-03-08 18:12:59 +05:30
$('body').on('click', '.js-toggle-colors-link', (e) => {
2018-03-17 18:26:18 +05:30
e.preventDefault();
2018-11-08 19:23:39 +05:30
$('.js-toggle-colors-container').toggleClass('hide');
2018-03-17 18:26:18 +05:30
});
$('li.project_member, li.group_member').on('ajax:success', refreshCurrentPage);
}