This page was last edited on September 26, 2018, at 19:59.
Comments or questions about this documentation? Contact us for support!
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('Overlay.close');
Opens the provided HTML in an Overlay View. When successful, it returns back the HTML and a custom close event for you to subscribe to. This alerts you when your overlay instance has been closed. You can also make your overlay immutable so that new overlay instances don't close yours. Only your widget can close its overlay when immutable is set to true.
oMyPlugin.command('Overlay.open', {
html: '<div>Template</div>',
immutable: false,
group: false
}).done(function(e){
// Overlay opens successfully
}).fail(function(e){
// Overlay failed to open
});
Option | Type | Description |
---|---|---|
html | string | HTML String template for overlay window. |
immutable | boolean | When set to true, overlay cannot be closed by other plugins. |
group | string | The name of the overlay window group you want to add a new overlay view into. |
Status | When | Returns |
---|---|---|
resolved | When overlay is successfully opened | {html: <template>, events: <Object>, group: <String>} |
rejected | When no html template is passed | 'No HTML content was provided. Overlay has ignored your command.' |
rejected | When overlay is already opened | 'Overlay view is currently reserved.' |
Closes the Overlay UI. Publishes the appropriate custom close event for current overlay being closed.
oMyPlugin.command('Overlay.close').done(function(e){
// Overlay closed successfully
}).fail(function(e){
// Overlay failed to close
});
Status | When | Returns |
---|---|---|
resolved | When Overlay is successfully closed. | n/a |
rejected | When Overlay is already closed. | 'Overlay view is already closed' |
rejected | When Overlay view is immutable. | 'Overlay view is currently reserved' |