Skip to content

Commit

Permalink
changed API to "toast", added toast.alert as the white message
Browse files Browse the repository at this point in the history
  • Loading branch information
catdad committed Oct 5, 2014
1 parent 2c90452 commit 21fe802
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<div class='section'>
<div class='title'>1.x.x new features</div>
<button onclick="toastr.logw('white message')">New white color</button>
<button onclick="toastr.alert('white message')">New white color</button>

<button onclick="clickableExample()">Clickable</button>
<button onclick="textAction()">Single action</button>
Expand Down
9 changes: 5 additions & 4 deletions toast.full.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tiny.toast 2014-10-01 */
/*! tiny.toast 2014-10-02 */
/* jshint browser: true, -W030 */

!function (window, document) {
Expand Down Expand Up @@ -166,7 +166,7 @@
//create toast element
var opts = toastOptions(arguments),
msg = opts.msg || '',
dismiss = opts.dismissable,
dismiss = opts.dismissible,
onclick = (typeof opts.onclick === 'function') ? opts.onclick : false,
timeout = (dismiss === false) ? -1 : opts.timeout,
prev = (opts.group && tracker[msg]) ? tracker[msg] : new Instance(msg),
Expand Down Expand Up @@ -205,12 +205,13 @@
});
}

var toastr = window.toastr = {
// toastr is legacy -- should I remove it?
var toastr = window.toastr = window.toast = {
timeout: 4000,
group: true,
clear: clearAll,
log: toaster('t-gray'),
logw: toaster('t-white'),
alert: toaster('t-white'),
error: toaster('t-red'),
info: toaster('t-blue'),
success: toaster('t-green'),
Expand Down
5 changes: 3 additions & 2 deletions toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@
});
}

var toastr = window.toastr = {
// toastr is legacy -- should I remove it?
var toastr = window.toastr = window.toast = {
timeout: 4000,
group: true,
clear: clearAll,
log: toaster('t-gray'),
logw: toaster('t-white'),
alert: toaster('t-white'),
error: toaster('t-red'),
info: toaster('t-blue'),
success: toaster('t-green'),
Expand Down
4 changes: 2 additions & 2 deletions toast.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21fe802

Please sign in to comment.