Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

[Improved] nuMessage()

Information about updates, news, Code Library
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

[Improved] nuMessage()

Unread post 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);

Post Reply