wikijs-fork/client/js/modals/admin-users-create.js

30 lines
585 B
JavaScript
Raw Normal View History

2017-01-04 05:07:15 +00:00
// Vue Create User instance
let vueCreateUser = new Vue({
el: '#modal-admin-users-create',
2017-01-04 05:07:15 +00:00
data: {
email: '',
provider: 'local',
password: '',
name: ''
},
methods: {
open: (ev) => {
$('#modal-admin-users-create').addClass('is-active');
$('#modal-admin-users-create input').first().focus();
2017-01-04 05:07:15 +00:00
},
cancel: (ev) => {
$('#modal-admin-users-create').removeClass('is-active');
2017-01-04 05:07:15 +00:00
vueCreateUser.email = '';
vueCreateUser.provider = 'local';
},
create: (ev) => {
vueCreateUser.cancel();
}
}
});
$('.btn-create-prompt').on('click', vueCreateUser.open);