import ListFooter from '../../components/controls/ListFooter';
import Tooltip from '../../components/controls/Tooltip';
import ModalForm from '../../components/common/modal-form';
+import SelectList from '../../components/SelectList';
const exposeLibraries = () => {
window.moment = moment;
Tooltip,
Select,
// deprecated, used in Governance
- ModalForm_deprecated: ModalForm
+ ModalForm_deprecated: ModalForm,
+ SelectList
};
};
*/
import escapeHtml from 'escape-html';
import Modal from '../../components/common/modals';
-import '../../components/SelectList';
+import SelectList from '../../components/SelectList';
import Template from './templates/groups-users.hbs';
export default Modal.extend({
extra.organization = this.organization.key;
}
- new window.SelectList({
+ new SelectList({
el: this.$('#groups-users'),
width: '100%',
readOnly: false,
*/
import Marionette from 'backbone.marionette';
import escapeHtml from 'escape-html';
-import '../../../components/SelectList';
+import SelectList from '../../../components/SelectList';
import { translate } from '../../../helpers/l10n';
export default Marionette.ItemView.extend({
onRender() {
const { qualityGate } = this.options;
- new window.SelectList({
+ new SelectList({
el: this.options.container,
width: '100%',
readOnly: !this.options.edit,
import Modal from 'react-modal';
import escapeHtml from 'escape-html';
import type { Profile } from '../propTypes';
+import SelectList from '../../../components/SelectList';
import { translate } from '../../../helpers/l10n';
type Props = {
const searchUrl =
window.baseUrl + '/api/qualityprofiles/projects?key=' + encodeURIComponent(key);
- new window.SelectList({
+ new SelectList({
searchUrl,
el: this.container,
width: '100%',
*/
import escapeHtml from 'escape-html';
import Modal from '../../components/common/modals';
-import '../../components/SelectList';
+import SelectList from '../../components/SelectList';
import Template from './templates/users-groups.hbs';
export default Modal.extend({
onRender() {
Modal.prototype.onRender.apply(this, arguments);
- new window.SelectList({
+ new SelectList({
el: this.$('#users-groups'),
width: '100%',
readOnly: false,
* SelectList Entry Point
*/
-window.SelectList = function(options) {
- this.settings = $.extend(window.SelectList.defaults, options);
+const SelectList = function(options) {
+ this.settings = $.extend(this.defaults, options);
this.collection = new SelectListCollection({
parse: this.settings.parse
* SelectList API Methods
*/
-window.SelectList.prototype.filter = function(filter) {
+SelectList.prototype.filter = function(filter) {
this.view.filterBySelection(filter);
return this;
};
-window.SelectList.prototype.search = function(query) {
+SelectList.prototype.search = function(query) {
this.view.searchByQuery(query);
return this;
};
* SelectList Defaults
*/
-window.SelectList.defaults = {
+SelectList.prototype.defaults = {
width: '50%',
height: 400,
errorMessage: 'Something gone wrong, try to reload the page and try again.'
};
+
+export default SelectList;