Allow disabling auto-dismiss of flash messages on mobile

This commit is contained in:
Lance Edgar 2018-01-25 14:15:25 -06:00
parent 96e5c42795
commit f32cf3342c
2 changed files with 9 additions and 4 deletions

View file

@ -62,10 +62,6 @@ $(document).on('pageshow', function() {
setfocus(); setfocus();
// TODO: seems like this should be better somehow...
// remove all flash messages after 2.5 seconds
window.setTimeout(function() { $('.flash, .error').remove(); }, 2500);
}); });

View file

@ -11,6 +11,15 @@
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js'))} ${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js'))} ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js'))}
${self.extra_javascript()} ${self.extra_javascript()}
% if request.rattail_config.getbool('tailbone', 'mobile.flash.autodismiss', default=True):
<script type="text/javascript">
$(document).on('pageshow', function() {
## TODO: seems like this should be better somehow...
// remove all flash messages after 2.5 seconds
window.setTimeout(function() { $('.flash, .error').remove(); }, 2500);
});
</script>
% endif
${h.stylesheet_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css')} ${h.stylesheet_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css')}
${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css'))} ${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css'))}