Skip to content

Commit

Permalink
Made the auto-hidding of the flash message a setting and added anothe…
Browse files Browse the repository at this point in the history
…r setting to increase the auto-hide time delay.
  • Loading branch information
sroutier committed Apr 9, 2018
1 parent c2b16c0 commit 982e6d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .settings-development.example
Expand Up @@ -15,6 +15,8 @@ app.user_profile_link=true
app.right_sidebar=true
app.email_notifications=false
app.time_format=24
app.flash_notification_auto_hide_enabled=true
app.flash_notification_auto_hide_delay=10

theme.default=default

Expand Down
2 changes: 2 additions & 0 deletions .settings-qa.example
Expand Up @@ -15,6 +15,8 @@ app.user_profile_link=true
app.right_sidebar=true
app.email_notifications=false
app.time_format=24
app.flash_notification_auto_hide_enabled=true
app.flash_notification_auto_hide_delay=10

theme.default=default

Expand Down
14 changes: 8 additions & 6 deletions resources/views/vendor/flash/message.blade.php
Expand Up @@ -15,13 +15,15 @@
{{ ucwords(Session::get('flash_notification.level')) }}!</h4>
{{ Session::get('flash_notification.message') }}
</div>
<script>
$(document).ready (function(){
$('div.alert').not('.alert-important').delay(4000).slideUp(200, function() {
$(this).alert('close');
@if (Setting::get('app.flash_notification_auto_hide_enabled', true))
<script>
$(document).ready (function(){
$('div.alert').not('.alert-important').delay({{ Setting::get('app.flash_notification_auto_hide_delay', true) * 1000 }}).slideUp(200, function() {
$(this).alert('close');
});
});
});
</script>
</script>
@endif
@endif
{{ Session::forget('flash_notification') }}
@endif

0 comments on commit 982e6d0

Please sign in to comment.