@extends('layout.master') @section('title', 'Notifications') @section('parentPageTitle', 'UI Elements') @section('content')

Message Context

Popup Positions

Callback Events

@stop @section('page-script') $(function() { toastr.options.timeOut = "false"; toastr.options.closeButton = true; toastr.options.positionClass = 'toast-bottom-right'; toastr['info']('Hi there, this is notification demo with HTML support. So, you can add HTML elements like this link'); $('.btn-toastr').on('click', function() { $context = $(this).data('context'); $message = $(this).data('message'); $position = $(this).data('position'); if ($context === '') { $context = 'info'; } if ($position === '') { $positionClass = 'toast-bottom-right'; } else { $positionClass = 'toast-' + $position; } toastr.remove(); toastr[$context]($message, '', { positionClass: $positionClass }); }); $('#toastr-callback1').on('click', function() { $message = $(this).data('message'); toastr.options = { "timeOut": "300", "onShown": function() { alert('onShown callback'); }, "onHidden": function() { alert('onHidden callback'); } }; toastr['info']($message); }); $('#toastr-callback2').on('click', function() { $message = $(this).data('message'); toastr.options = { "timeOut": "10000", "onclick": function() { alert('onclick callback'); }, }; toastr['info']($message); }); $('#toastr-callback3').on('click', function() { $message = $(this).data('message'); toastr.options = { "timeOut": "10000", "closeButton": true, "onCloseClick": function() { alert('onCloseClick callback'); } }; toastr['info']($message); }); }); @stop