core/fragment

A way to call HTML fragments to be inserted as required via JavaScript.

Source:
Since:
  • 3.1
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Methods

(inner) fragmentAppend(component, callback, contextid, params) → {Deferred}

Source:

Appends HTML and JavaScript fragments to specified nodes. Callbacks called by this AMD module are responsible for doing the appropriate security checks to access the information that is returned. This only does minimal validation on the context.

Parameters:
Name Type Description
component string

Component where callback is located.

callback string

Callback function name.

contextid integer

Context ID of the fragment.

params object

Parameters for the callback.

Returns:

new promise that is resolved with the html and js.

Type
Deferred

(inner) loadFragment(component, callback, contextid, params) → {Promise}

Source:

Loads an HTML fragment through a callback.

Parameters:
Name Type Description
component string

Component where callback is located.

callback string

Callback function name.

contextid integer

Context ID of the fragment.

params object

Parameters for the callback.

Returns:

JQuery promise object resolved when the fragment has been loaded.

Type
Promise

(inner) processCollectedJavascript(js) → {string}

Source:

Converts the JS that was received from collecting JS requirements on the $PAGE so it can be added to the existing page

Parameters:
Name Type Description
js string
Returns:
Type
string