[fix] Do not show all logs when clicking on 'log' button.

This commit is contained in:
opi 2015-10-08 18:05:43 +02:00
parent c51f8dc0b3
commit 06c8fae22d
2 changed files with 4 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -81,16 +81,15 @@ var app = Sammy('#main', function (sam) {
}
} else {
if (level == 'log') {
$('#flash').append('<pre style="display:none" class="alert alert-dismissable '+ alertClass +'"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><div><button type="button" class="btn btn-default btn-small">'+ y18n.t('log') +'</button></div><p style="display: none">'+ message +'</p></pre>').show();
$('#flash').append('<pre style="display:none" class="alert alert-dismissable '+ alertClass +'"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><button type="button" class="btn btn-default btn-small" data-show="log">'+ y18n.t('log') +'</button><p style="display: none">'+ message +'</p></pre>').show();
} else {
$('#flash').append('<div style="display:none" class="alert alert-dismissable '+ alertClass +'"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><p>'+ message +'</p></div>').show();
}
$('#flash .alert').last().fadeIn();
}
document.body.scrollTop = document.documentElement.scrollTop = 0;
$('#flash .alert-log button.btn-small').on('click', function() {
$('#flash .alert-log p:hidden').fadeIn();
$('#flash .alert-log div').hide();
$('#flash [data-show="log"]').on('click', function() {
$(this).hide().nextAll('p').fadeIn();
});
},