diff --git a/README.md b/README.md index 7cd371e..79bb7b5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# Toast - A Bootstrap 4.2+ jQuery plugin +# Toast - A Bootstrap 5.0+ jQuery plugin * [About](#about) * [Usage](#usage) * [Live Example](https://jsfiddle.net/47n5ygth/) + * [Live Demo Using Bootstrap 5](https://demo.halimlardjane.com/toast/) +* [Contributing](#contributing) * [Contributing](#contributing) ### About @@ -21,6 +23,7 @@ $.toastDefaults = { dismissible: true, /** true/false - If you want to show the button to dismiss the toast manually **/ stackable: true, /** true/false - If you want the toasts to be stackable **/ pauseDelayOnHover: true, /** true/false - If you want to pause the delay of toast when hovering over the toast **/ + width: 500, /** Integer - if you want to custom the size of the toast */ style: { toast: '', /** Classes you want to apply separated my a space to each created toast element (.toast) **/ info: '', /** Classes you want to apply separated my a space to modify the "info" type style **/ diff --git a/dist/toast.min.css b/dist/toast.min.css index 819cea8..087f4f3 100644 --- a/dist/toast.min.css +++ b/dist/toast.min.css @@ -1 +1 @@ -.toast-container{position:fixed;z-index:1055;margin:5px}.top-right{top:0;right:0}.top-left{top:0;left:0}.top-center{transform:translateX(-50%);top:0;left:50%}.bottom-right{right:0;bottom:0}.bottom-left{left:0;bottom:0}.bottom-center{transform:translateX(-50%);bottom:0;left:50%}.toast-container>.toast{min-width:150px;background:0 0;border:none}.toast-container>.toast>.toast-header{border:none}.toast-container>.toast>.toast-header strong{padding-right:20px}.toast-container>.toast>.toast-body{background:#fff} +.toast-container{position:fixed;z-index:1055;margin:5px}.toast-container.top-right{top:0;right:0}.toast-container.top-left{top:0;left:0}.toast-container.top-center{transform:translateX(-50%);top:0;left:50%}.toast-container.bottom-right{right:0;bottom:0}.toast-container.bottom-left{left:0;bottom:0}.toast-container.bottom-center{transform:translateX(-50%);bottom:0;left:50%}.toast-container>.toast{min-width:150px;background:0 0;border:none}.toast-container>.toast>.toast-header{border:none}.toast-container>.toast>.toast-header strong{padding-right:20px}.toast-container>.toast>.toast-body{background:#fff} \ No newline at end of file diff --git a/dist/toast.min.js b/dist/toast.min.js index 9960b28..2b2e10c 100644 --- a/dist/toast.min.js +++ b/dist/toast.min.js @@ -1,6 +1 @@ -(function(a){function f(b){if(!a("#toast-container").length){var d="top-right top-left top-center bottom-right bottom-left bottom-center".split(" ").includes(a.toastDefaults.position)?a.toastDefaults.position:"top-right";a("body").prepend('
');a("#toast-container").addClass(d)}d=a("#toast-container");var c="",e=c="",g=b.id||"toast-"+l,t=b.type,u=b.title,m=b.subtitle,n=b.content,h=b.img,p=b.delay?'data-delay="'+ - b.delay+'"':'data-autohide="false"',q="",r=a.toastDefaults.dismissible,v=a.toastDefaults.style.toast,k=!1;"undefined"!==typeof b.dismissible&&(r=b.dismissible);switch(t){case "info":e=a.toastDefaults.style.info||"bg-info";c=a.toastDefaults.style.info||"text-white";break;case "success":e=a.toastDefaults.style.success||"bg-success";c=a.toastDefaults.style.info||"text-white";break;case "warning":e=a.toastDefaults.style.warning||"bg-warning";c=a.toastDefaults.style.warning||"text-white";break;case "error":e= - a.toastDefaults.style.error||"bg-danger",c=a.toastDefaults.style.error||"text-white"}a.toastDefaults.pauseDelayOnHover&&b.delay&&(p='data-autohide="false"',q='data-hide-after="'+(Math.floor(Date.now()/1E3)+b.delay/1E3)+'"');c='