debian-mirror-gitlab/app/assets/javascripts/access_tokens/index.js

36 lines
627 B
JavaScript
Raw Normal View History

2020-05-24 23:13:21 +05:30
import Vue from 'vue';
import ExpiresAtField from './components/expires_at_field.vue';
2021-01-29 00:20:46 +05:30
const getInputAttrs = el => {
const input = el.querySelector('input');
return {
id: input.id,
name: input.name,
placeholder: input.placeholder,
};
};
2020-05-24 23:13:21 +05:30
const initExpiresAtField = () => {
2021-01-29 00:20:46 +05:30
const el = document.querySelector('.js-access-tokens-expires-at');
if (!el) {
return null;
}
const inputAttrs = getInputAttrs(el);
return new Vue({
el,
render(h) {
return h(ExpiresAtField, {
props: {
inputAttrs,
},
});
},
2020-05-24 23:13:21 +05:30
});
};
export default initExpiresAtField;