Remove members and memberExpirationDate from window object
This commit is contained in:
parent
019032747a
commit
697967c177
|
@ -81,6 +81,8 @@ import AbuseReports from './abuse_reports';
|
||||||
import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils';
|
import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils';
|
||||||
import AjaxLoadingSpinner from './ajax_loading_spinner';
|
import AjaxLoadingSpinner from './ajax_loading_spinner';
|
||||||
import U2FAuthenticate from './u2f/authenticate';
|
import U2FAuthenticate from './u2f/authenticate';
|
||||||
|
import Members from './members';
|
||||||
|
import memberExpirationDate from './member_expiration_date';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var Dispatcher;
|
var Dispatcher;
|
||||||
|
@ -397,15 +399,15 @@ import U2FAuthenticate from './u2f/authenticate';
|
||||||
new ProjectsList();
|
new ProjectsList();
|
||||||
break;
|
break;
|
||||||
case 'groups:group_members:index':
|
case 'groups:group_members:index':
|
||||||
new gl.MemberExpirationDate();
|
memberExpirationDate();
|
||||||
new gl.Members();
|
new Members();
|
||||||
new UsersSelect();
|
new UsersSelect();
|
||||||
break;
|
break;
|
||||||
case 'projects:project_members:index':
|
case 'projects:project_members:index':
|
||||||
new gl.MemberExpirationDate('.js-access-expiration-date-groups');
|
memberExpirationDate('.js-access-expiration-date-groups');
|
||||||
new GroupsSelect();
|
new GroupsSelect();
|
||||||
new gl.MemberExpirationDate();
|
memberExpirationDate();
|
||||||
new gl.Members();
|
new Members();
|
||||||
new UsersSelect();
|
new UsersSelect();
|
||||||
break;
|
break;
|
||||||
case 'groups:new':
|
case 'groups:new':
|
||||||
|
|
|
@ -84,8 +84,6 @@ import './layout_nav';
|
||||||
import LazyLoader from './lazy_loader';
|
import LazyLoader from './lazy_loader';
|
||||||
import './line_highlighter';
|
import './line_highlighter';
|
||||||
import './logo';
|
import './logo';
|
||||||
import './member_expiration_date';
|
|
||||||
import './members';
|
|
||||||
import './merge_request';
|
import './merge_request';
|
||||||
import './merge_request_tabs';
|
import './merge_request_tabs';
|
||||||
import './milestone';
|
import './milestone';
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
import Pikaday from 'pikaday';
|
import Pikaday from 'pikaday';
|
||||||
|
|
||||||
(() => {
|
|
||||||
// Add datepickers to all `js-access-expiration-date` elements. If those elements are
|
// Add datepickers to all `js-access-expiration-date` elements. If those elements are
|
||||||
// children of an element with the `clearable-input` class, and have a sibling
|
// children of an element with the `clearable-input` class, and have a sibling
|
||||||
// `js-clear-input` element, then show that element when there is a value in the
|
// `js-clear-input` element, then show that element when there is a value in the
|
||||||
// datepicker, and make clicking on that element clear the field.
|
// datepicker, and make clicking on that element clear the field.
|
||||||
//
|
//
|
||||||
window.gl = window.gl || {};
|
export default function memberExpirationDate(selector = '.js-access-expiration-date') {
|
||||||
gl.MemberExpirationDate = (selector = '.js-access-expiration-date') => {
|
|
||||||
function toggleClearInput() {
|
function toggleClearInput() {
|
||||||
$(this).closest('.clearable-input').toggleClass('has-value', $(this).val() !== '');
|
$(this).closest('.clearable-input').toggleClass('has-value', $(this).val() !== '');
|
||||||
}
|
}
|
||||||
|
@ -51,5 +49,4 @@ import Pikaday from 'pikaday';
|
||||||
inputs.on('blur', toggleClearInput);
|
inputs.on('blur', toggleClearInput);
|
||||||
|
|
||||||
inputs.each(toggleClearInput);
|
inputs.each(toggleClearInput);
|
||||||
};
|
}
|
||||||
}).call(window);
|
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
/* eslint-disable class-methods-use-this */
|
export default class Members {
|
||||||
(() => {
|
|
||||||
window.gl = window.gl || {};
|
|
||||||
|
|
||||||
class Members {
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.addListeners();
|
this.addListeners();
|
||||||
this.initGLDropdown();
|
this.initGLDropdown();
|
||||||
|
@ -37,7 +33,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
removeRow(e) {
|
removeRow(e) {
|
||||||
const $target = $(e.target);
|
const $target = $(e.target);
|
||||||
|
|
||||||
|
@ -65,7 +61,7 @@
|
||||||
$toggle.enable();
|
$toggle.enable();
|
||||||
$dateInput.enable();
|
$dateInput.enable();
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
getMemberListItems($el) {
|
getMemberListItems($el) {
|
||||||
const $memberListItem = $el.is('.member') ? $el : $(`#${$el.data('el-id')}`);
|
const $memberListItem = $el.is('.member') ? $el : $(`#${$el.data('el-id')}`);
|
||||||
|
|
||||||
|
@ -76,6 +72,3 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.Members = Members;
|
|
||||||
})();
|
|
||||||
|
|
Loading…
Reference in New Issue