Skip to content

Using toast() to display popup notifications in 2.1

667bdrm edited this page Jul 20, 2018 · 2 revisions

During the integration you could use elFinder api to display third party software notifications using toast() function.

toast() takes one parameters object with the following properties:

msg - message text

mode - message type, could be info, warning or error

hideDuration - popup hiding duration

showDuration - popup showing duration

timeOut - popup timeout between show and hide

Example:

var fm = $('#finder').elfinder(elfinderOpts);
var instance = fm.elfinder('instance');

if (typeof instance == 'object' && typeof instance.toast == 'function') {
  instance.bind('load', function(event) {
    instance.toast({
      msg: 'My message',
      hideDuration: 500,
      showDuration: 300,
      timeOut: 1000,
      mode: 'info'
    });

 });
}
Clone this wiki locally