PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / trunk
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses vtrunk
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / assets / src / js / lpToastify.js

lpToastify.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses trunk, at assets/src/js/lpToastify.js

35 lines 810 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Utils functions
3 *
4 * @param url
5 * @param data
6 * @param functions
7 * @since 4.3.0
8 * @version 1.0.0
9 */
10 import Toastify from 'toastify-js';
11 import 'toastify-js/src/toastify.css';
12
13 const argsToastify = {
14 text: '',
15 gravity: lpData.toast.gravity, // `top` or `bottom`
16 position: lpData.toast.position, // `left`, `center` or `right`
17 className: `${ lpData.toast.classPrefix }`,
18 close: lpData.toast.close == 1,
19 stopOnFocus: lpData.toast.stopOnFocus == 1,
20 duration: lpData.toast.duration,
21 };
22 export const show = ( message, status = 'success', argsCustom ) => {
23 let args = argsToastify;
24 if ( argsCustom ) {
25 args = { ...args, ...argsCustom };
26 }
27
28 const toastify = new Toastify( {
29 ...args,
30 text: message,
31 className: `${ lpData.toast.classPrefix } ${ status }`,
32 } );
33 toastify.showToast();
34 };
35