Page 1 of 1

[Improved] nuMessage()

Posted: Sat Mar 20, 2021 11:35 am
by admin
Improved nuMessage() in V.4.5-2021.03.20.00 (Github)

Added: New (optional) parameter timeout. Timeout in seconds. After the timeout has elapsed the message box will be automatically closed.
Added: New (optional) parameter callback. Executes a callback function after the timeout has elapsed.
Changed: The message text also accepts a string instead of an array

Usage examples

Passing 'Hello' as string instead of an array is now also possible:

Code: Select all

nuMessage('Hello');
Previoulsy:

Code: Select all

nuMessage(['Hello']);
Close the message box after 2 seconds:

Code: Select all

nuMessage('Hello', 2000);
Close the message box after 1.5 seconds and call the callback function messageClosed();

Code: Select all


function messageClosed() {
   nuOpenPreviousBreadcrumb(); // return to the previous Breadcrumb
}

nuMessage('Hello', 1500, messageClosed);