fixes #50 - summary page progress on saves
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
function updateResults(elem) {
|
||||
if ($(elem).length ===0){return false;};
|
||||
if ($(elem).length ===0){return false;}
|
||||
|
||||
var resultsContainer = $(elem).find('[data-id="results"]')[0];
|
||||
var codeHtml = $(elem).find('.code-html')[0].value.trim();
|
||||
|
@ -32,11 +32,22 @@ function updateLocalValues($form){
|
||||
});
|
||||
}
|
||||
|
||||
function updateProgress(data) {
|
||||
$(".progress-bar").attr('aria-valuenow', data.progress)
|
||||
.attr('style','width: '+ data.progress +'%;')
|
||||
.find('span').text(data.progress + '%');
|
||||
if(data.can_submit === true){
|
||||
$('#summary-submit').find('.error').remove();
|
||||
$('#summary-submit').find('.submit-button').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
function prepareAjax($form) {
|
||||
$form.on("ajax:success", function(e, data){
|
||||
$form.prepend('<div class="success">' + data.message + '</div>');
|
||||
disableForm($form);
|
||||
updateLocalValues($form);
|
||||
updateProgress(data);
|
||||
}).on("ajax:error", function(e, xhr) {
|
||||
if (xhr.status === 400){
|
||||
$form.prepend('<div class="error">' + xhr.responseJSON.join('<br>') + '</div>');
|
||||
|
@ -29,6 +29,10 @@ label {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
form.btn-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#{$all-text-inputs} {
|
||||
display: block;
|
||||
font-size: $base-font-size;
|
||||
|
Reference in New Issue
Block a user