Overlay#
- get_overlay(uid)#
Return overlay instance by uid.
- Arguments
uid (
string()) – Overlay UID.
- Returns
Overlay – Overlay instance or null if not found.
- show_message(opts)#
Display overlay message:
ts.show_message({ title: 'Message title', message: 'Message text', flavor: 'info' });
- Arguments
opts (
Object()) – Message options.opts.title (
string()) – Optional message title to display in overlay header.opts.message (
string()) – Message to display in overlay content.opts.flavor (
string()) – Optional message flavor. Eitherinfo,warningorerror.
- show_info(message)#
Display info message in overlay:
ts.show_info('Info text');
- Arguments
message (
string()) – Info message to display in overlay content.
- show_warning(message)#
Display warning message in overlay:
ts.show_warning('Warning text');
- Arguments
message (
string()) – Warning message to display in overlay content.
- show_error(message)#
Display error message in overlay:
ts.show_error('Error text');
- Arguments
message (
string()) – Error message to display in overlay content.
- show_dialog(opts)#
Display confirmation dialog:
ts.show_dialog({ title: 'Dialog title', message: 'Are you sure?', on_confirm: function(inst) { // inst is the dialog instance. } });
- Arguments
opts (
Object()) – Dialog options.opts.title (
string()) – Optional dialog title to display in overlay header.opts.message (
string()) – Dialog message to display in overlay content.opts.on_confirm (
function()) – Callback if dialog gets confirmed.