Newer
Older
(function () {
window.credentials = {
editClicked: function (event) {
if (event.status === 'success') {
$('#credentials-modal').modal('show');
}
},
credentialsSaved: function (event) {
if (event.status === 'success') {
if ($('#credentials-modal .text-danger').length === 0) {
$('#credentials-modal').modal('hide');
}
}
}
};
Sonia Zorba
committed
$(document).ready(function () {
$('body').on('shown.bs.modal', '#credentials-modal', function ( ) {
$.post(TSM.getRestPath("credentialsDialog?opened=true"));
Sonia Zorba
committed
});
$('body').on('hidden.bs.modal', '#credentials-modal', function ( ) {
$.post(TSM.getRestPath("credentialsDialog?opened=false"));
Sonia Zorba
committed
});
Sonia Zorba
committed
$('body').on('keyup', '#credentials-modal input', function (event) {
if (event.keyCode === 13) {
$('#main\\:save-credentials').click();
event.preventDefault();
}
});
Sonia Zorba
committed
});