You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. (function($) {
  2. showSuccessToast = function() {
  3. 'use strict';
  4. resetToastPosition();
  5. $.toast({
  6. heading: 'Success',
  7. text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
  8. showHideTransition: 'slide',
  9. icon: 'success',
  10. loaderBg: '#f96868',
  11. position: 'top-right'
  12. })
  13. };
  14. showInfoToast = function() {
  15. 'use strict';
  16. resetToastPosition();
  17. $.toast({
  18. heading: 'Info',
  19. text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
  20. showHideTransition: 'slide',
  21. icon: 'info',
  22. loaderBg: '#46c35f',
  23. position: 'top-right'
  24. })
  25. };
  26. showWarningToast = function() {
  27. 'use strict';
  28. resetToastPosition();
  29. $.toast({
  30. heading: 'Warning',
  31. text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
  32. showHideTransition: 'slide',
  33. icon: 'warning',
  34. loaderBg: '#57c7d4',
  35. position: 'top-right'
  36. })
  37. };
  38. showDangerToast = function() {
  39. 'use strict';
  40. resetToastPosition();
  41. $.toast({
  42. heading: 'Danger',
  43. text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
  44. showHideTransition: 'slide',
  45. icon: 'error',
  46. loaderBg: '#f2a654',
  47. position: 'top-right'
  48. })
  49. };
  50. showToastPosition = function(position) {
  51. 'use strict';
  52. resetToastPosition();
  53. $.toast({
  54. heading: 'Positioning',
  55. text: 'Specify the custom position object or use one of the predefined ones',
  56. position: String(position),
  57. icon: 'success',
  58. stack: false,
  59. loaderBg: '#f96868'
  60. })
  61. }
  62. showToastInCustomPosition = function() {
  63. 'use strict';
  64. resetToastPosition();
  65. $.toast({
  66. heading: 'Custom positioning',
  67. text: 'Specify the custom position object or use one of the predefined ones',
  68. icon: 'success',
  69. position: {
  70. left: 120,
  71. top: 120
  72. },
  73. stack: false,
  74. loaderBg: '#f96868'
  75. })
  76. }
  77. resetToastPosition = function() {
  78. $('.jq-toast-wrap').removeClass('bottom-left bottom-right top-left top-right mid-center'); // to remove previous position class
  79. $(".jq-toast-wrap").css({
  80. "top": "",
  81. "left": "",
  82. "bottom": "",
  83. "right": ""
  84. }); //to remove previous position style
  85. }
  86. })(jQuery);