os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Added posibility to override Splash screen (#110) #111

Closed andersevenrud closed 4 years ago

andersevenrud commented 4 years ago

This commit adds the following option and export to allow override of the initial splash screen.

Example:

import {Core, Splash} from '@osjs/client';

class CustomSplash extends Splash {
  init() {
    // This is the default, you can override this
    this.$loading
      .appendChild(document.createTextNode('Loading...'));
  }
}

// In your bootstrap add an option to a callback
// to point to the new splash instance.
new Core(config, {
  splash: core => new CustomSplash(core)
});
andersevenrud commented 4 years ago

Ref: https://github.com/os-js/osjs-client/issues/110