From 3b2147d2218dec8e87006f69aa25472a56283144 Mon Sep 17 00:00:00 2001 From: oliveira131 <47257731+oliveira131@users.noreply.github.com> Date: Mon, 22 Jul 2019 00:38:18 -0300 Subject: [PATCH] Update toast to 0.8.0 with ico and more colors Add more title colors (primary, secondary, white, light and transparent) and icon use. --- js/toast.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/js/toast.js b/js/toast.js index 74575fd..e8befb2 100644 --- a/js/toast.js +++ b/js/toast.js @@ -1,7 +1,7 @@ /** * @author Script47 (https://github.com/Script47/Toast) * @description Toast - A Bootstrap 4.2+ jQuery plugin for the toast component - * @version 0.7.1 + * @version 0.8.0 **/ (function ($) { var TOAST_CONTAINER_HTML = '
'; @@ -36,6 +36,7 @@ type = opts.type || 'info', delay = opts.delay || -1, img = opts.img, + ico = opts.ico, pause_on_hover = opts.pause_on_hover || false, pause = false, delay_or_autohide = ''; @@ -70,6 +71,48 @@ fg_subtitle_class = 'text-white'; fg_dismiss_class = 'text-white'; break; + + case 'dark': + bg_header_class = 'bg-dark'; + fg_header_class = 'text-white'; + fg_subtitle_class = 'text-white'; + fg_dismiss_class = 'text-white'; + break; + + case 'primary': + bg_header_class = 'bg-primary'; + fg_header_class = 'text-white'; + fg_subtitle_class = 'text-white'; + fg_dismiss_class = 'text-white'; + break; + + case 'secondary': + bg_header_class = 'bg-secondary'; + fg_header_class = 'text-white'; + fg_subtitle_class = 'text-white'; + fg_dismiss_class = 'text-white'; + break; + + case 'light': + bg_header_class = 'bg-light'; + fg_header_class = ''; + fg_subtitle_class = ''; + fg_dismiss_class = ''; + break; + + case 'white': + bg_header_class = 'bg-white'; + fg_header_class = 'text-dark'; + fg_subtitle_class = 'text-dark'; + fg_dismiss_class = 'text-dark'; + break; + + case 'transparent': + bg_header_class = 'bg-transparent'; + fg_header_class = ''; + fg_subtitle_class = ''; + fg_dismiss_class = ''; + break; } if (pause_on_hover !== false) { @@ -88,11 +131,15 @@ html = '