Fix note feedback

This commit is contained in:
2019-09-08 09:49:55 +02:00
parent aaaed4d784
commit 6c14d9eba0
5 changed files with 23 additions and 24 deletions

View File

@@ -50,6 +50,9 @@ oCATC.pageInit = function(asHash, bFirstPage) {
oCATC.feedback('notice', sMsg); oCATC.feedback('notice', sMsg);
}); });
loadDocs(); loadDocs();
},
progressall: function (e, asData) {
$('#progress .bar').css('width', parseInt(asData.loaded / asData.total * 100, 10)+'%');
} }
}); });
loadDocs(); loadDocs();
@@ -76,13 +79,15 @@ function loadDocs() {
} }
function noteFeedback(sType, sMsg) { function noteFeedback(sType, sMsg) {
var $Feedback = $('#notes_feedback').stop(); var $Feedback = $('#notes_feedback');
if(sMsg != $Feedback.find('span').text()) { if(sMsg != $Feedback.find('.alert').text()) {
$Feedback.fadeOut($Feedback.is(':empty')?0:'fast', function(){ $Feedback.finish().fadeOut($Feedback.is(':empty')?0:'fast', function(){
$(this) $(this)
.empty() .empty()
.append($('<span>', {'class':sType}).text(sMsg)) .append($('<div>', {'class':'alert alert-'+sType, role:'alert'}).text(sMsg))
.fadeIn('fast'); .fadeIn('fast')
.delay(5000)
.fadeOut('fast');
}); });
} }
}; };

View File

@@ -18,3 +18,7 @@ $theme-colors: map-remove($theme-colors, "light", "dark");
$font-family-base: $font_para; $font-family-base: $font_para;
@import 'bootstrap/bootstrap'; @import 'bootstrap/bootstrap';
.alert-error {
@extend .alert-danger;
}

View File

@@ -49,13 +49,10 @@
width: 50%; width: 50%;
text-align: right; text-align: right;
span { .alert {
position: absolute; font-size: 0.8em;
width: 100%; margin: 0;
display: inline-block; padding-right: 0.5em;
top: 50%;
transform: translateY(-50%);
right: 0;
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long