Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the option to set a icon for the toast title #16

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update index.html
roalvesrj authored Dec 15, 2019
commit be20afb963595f98c1f9a38624cc114810fea72e
17 changes: 17 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@
<br>
<button class="btn-block btn-primary" onclick="show_image_toast();">Show Image Toast</button>
<br>
<button class="btn-block btn-primary" onclick="show_icon_toast();">Show Icon Toast</button>
<br>
<button class="btn-block btn-primary" onclick="show_random_snack();">Show Random Snack</button>
<br>
<button class="btn-block btn-primary" onclick="show_toast_in_container();">Show Toast in Container</button>
@@ -86,6 +88,21 @@
});
}

function show_icon_toast() {
let type = TYPES[Math.floor(Math.random() * TYPES.length)],
title = TITLES[type],
content = CONTENT[type];

$.toast({
title: title,
subtitle: '11 mins ago',
content: content,
type: type,
delay: 5000,
icon: 'fas fa-user-secret'
});
}

function show_random_snack() {
let type = TYPES[Math.floor(Math.random() * TYPES.length)],
content = CONTENT[type].replace('toast', 'snack');