From e5495630bbe0498e27eddbfe3de9b2052ecdb96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Alves?= Date: Sun, 15 Dec 2019 17:10:53 -0300 Subject: [PATCH 1/5] Update toast.css --- css/toast.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/css/toast.css b/css/toast.css index fbab545..e98072c 100644 --- a/css/toast.css +++ b/css/toast.css @@ -26,3 +26,8 @@ .toast-container>.toast-wrapper>.toast>.toast-header strong { padding-right: 20px; } + +.toast-container > .toast-wrapper > .toast > .toast-header i { + padding-top:2px; + margin-right:7px; +} From 2df7c678e1b00df342229c4e812f7b871907ac1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Alves?= Date: Sun, 15 Dec 2019 17:12:39 -0300 Subject: [PATCH 2/5] Update toast.min.css --- dist/toast.min.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/toast.min.css b/dist/toast.min.css index 6fa9ca2..9fd1318 100644 --- a/dist/toast.min.css +++ b/dist/toast.min.css @@ -3,4 +3,4 @@ * @description Toast - A Bootstrap 4.2+ jQuery plugin for the toast component * @version 0.7.1 **/ -.toast-container{position:sticky;z-index:1055;top:0}.toast-wrapper{position:absolute;z-index:1055;top:0;right:0;margin:5px}.toast-container > .toast-wrapper > .toast{min-width:150px;background-color:rgb(255, 255, 255);border-top:none}.toast-container > .toast-wrapper > .toast > .toast-header strong{padding-right:20px} +.toast-container{position:sticky;z-index:1055;top:0}.toast-wrapper{position:absolute;z-index:1055;top:0;right:0;margin:5px}.toast-container > .toast-wrapper > .toast{min-width:150px;background-color:rgb(255, 255, 255);border-top:none}.toast-container > .toast-wrapper > .toast > .toast-header strong{padding-right:20px}.toast-container > .toast-wrapper > .toast > .toast-header i{padding-top:2px;margin-right:7px;} From 21c33e3fb84cbff312fdcfd89f5427ffb1191fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Alves?= Date: Sun, 15 Dec 2019 17:14:36 -0300 Subject: [PATCH 3/5] Update toast.js --- js/toast.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/toast.js b/js/toast.js index 74575fd..27d4720 100644 --- a/js/toast.js +++ b/js/toast.js @@ -36,6 +36,7 @@ type = opts.type || 'info', delay = opts.delay || -1, img = opts.img, + icon = opts.icon, pause_on_hover = opts.pause_on_hover || false, pause = false, delay_or_autohide = ''; @@ -92,6 +93,10 @@ html += '' + (img.alt || 'Image') + ''; } + if (typeof icon !== 'undefined') { + html += ''; + } + html += '' + title + ''; html += '' + subtitle + ''; html += '
+ +

@@ -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');