Skip to content

Commit

Permalink
Fixed issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Offen committed Apr 1, 2016
1 parent 22480c5 commit ff46411
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

<title>jQuery Toaster Plugin Demo</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand Down Expand Up @@ -75,7 +74,7 @@ <h3 class="panel-title">Make Your Own Toast</h3>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!--<![endif]-->

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="./jquery.toaster.js"></script>
<script>
var interval;
Expand Down
12 changes: 7 additions & 5 deletions jquery.toaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@

notify : function (title, message, priority)
{
var $toaster = this.gettoaster();
var $toast = $(settings.toast.template.replace('%priority%', priority)).hide().css(settings.toast.css).addClass(settings.toast['class']);
var $toaster = this.gettoaster();
var delimiter = (title && message) ? settings.toast.defaults.delimiter : '';
var $toast = $(settings.toast.template.replace('%priority%', priority).replace('%delimiter%', delimiter)).hide().css(settings.toast.css).addClass(settings.toast['class']);

$('.title', $toast).css(settings.toast.csst).html(title);
$('.message', $toast).css(settings.toast.cssm).html(message);
Expand Down Expand Up @@ -105,13 +106,14 @@
'<span aria-hidden="true">&times;</span>' +
'<span class="sr-only">Close</span>' +
'</button>' +
'<span class="title"></span>: <span class="message"></span>' +
'<span class="title"></span>%delimiter% <span class="message"></span>' +
'</div>',

'defaults' :
{
'title' : 'Notice',
'priority' : 'success'
'title' : 'Notice',
'priority' : 'success',
'delimiter' : ':'
},

'css' : {},
Expand Down

0 comments on commit ff46411

Please sign in to comment.