tinymce.dom.StyleSheetLoader

This class handles loading of external stylesheets and fires events when these are loaded.

Summary

Methods

Name Summary Defined by

load()

Loads the specified CSS file and returns a Promise that will resolve when the stylesheet is loaded successfully or reject if it failed to load.

StyleSheetLoader

loadAll()

Loads the specified CSS files and returns a Promise that is resolved when all stylesheets are loaded or rejected if any failed to load.

StyleSheetLoader

loadRawCss()

Loads the specified css string in as a style element with an unique key.

StyleSheetLoader

unload()

Unloads the specified CSS file if no resources currently depend on it.

StyleSheetLoader

unloadAll()

Unloads each specified CSS file if no resources currently depend on it.

StyleSheetLoader

unloadRawCss()

Unloads the specified CSS style element by key.

StyleSheetLoader

Methods

load()

load(url: String): Promise

Loads the specified CSS file and returns a Promise that will resolve when the stylesheet is loaded successfully or reject if it failed to load.

Parameters

  • url (String) - Url to be loaded.

Return value

  • Promise - A Promise that will resolve or reject when the stylesheet is loaded.


loadAll()

loadAll(urls: Array): Promise

Loads the specified CSS files and returns a Promise that is resolved when all stylesheets are loaded or rejected if any failed to load.

Parameters

  • urls (Array) - URLs to be loaded.

Return value

  • Promise - A Promise that will resolve or reject when all stylesheets are loaded.


loadRawCss()

loadRawCss(key: String, css: String)

Loads the specified css string in as a style element with an unique key.

Parameters

  • key (String) - Unique key for the style element.

  • css (String) - Css style content to add.


unload()

unload(url: String)

Unloads the specified CSS file if no resources currently depend on it.

Parameters

  • url (String) - URL to unload or remove.


unloadAll()

unloadAll(urls: Array)

Unloads each specified CSS file if no resources currently depend on it.

Parameters

  • urls (Array) - URLs to unload or remove.


unloadRawCss()

unloadRawCss(key: String)

Unloads the specified CSS style element by key.

Parameters

  • key (String) - Key of CSS style resource to unload.