Page tree
Skip to end of metadata
Go to start of metadata

This function hides the EditLive! applet and replaces it with a placeholder so that DOM elements can display on top of the applet. This overcomes a z-order bug in Java and is useful for AJAX applications. 

In most browsers, the placeholder is an actual screenshot of the applet, so the process is smooth and the user will most likely not notice the transition. In Internet Explorer 6 and 7, the placeholder is just a grey box due to browser limitations.

Syntax

JavaScript
editliveInstance.setBackgroundMode(mode, callback);

Parameters

mode

A boolean that specifies the mode to change to.

  • true changes to background mode, hiding the applet and replacing it with a placeholder.
  • false changes back to normal mode.

callback

Reference to a function that is invoked when the mode change completes. This reference can either be a javascript function reference, or the fully-qualified name of a javascript function.

You should wait for the callback to fire before performing other actions (e.g. displaying AJAX lightboxes)

8.0.1 and below: The callback is only fired if the mode actually changes, e.g. if you set background mode to true and it's already true, then the callback is not called.

8.0.2 and above: The callback is always fired.

9.0.1 and below: This function requires the setBackgroundMode plugin. To enable this, ensure the following line is in your config, under <plugins>

<plugin name="setBackgroundMode" />

9.0.2 and above: The plugin tag for setBackgroundMode is not required to enable this capability. If you leave this tag in your configuration file you will see errors in the EditLive! debug log, but EditLive! will function properly.

9.1.0.185 and above: A click on the placeholder image will deactivate background mode (no callback is fired). This is a safety measure. If for some reason the editor is still in background mode after hiding all DOM elements that covered the editor, the editor can now be "reactivated" by clicking on it.

  • No labels