src/js/libs/spiritual-gui.js
function(action, thisp) {
			var is = this.initialized;
			if (arguments.length) {
				if (is) {
					action.call(thisp);
				} else {
					this._initcallbacks = this._initcallbacks || [];
					this._initcallbacks.push(function() {
						if (gui.debug) {
							try {
								action.call(thisp);
							} catch (exception) {
								console.error(action.toString());
								throw exception;
							}
						} else {
							action.call(thisp);
						}
					});
				}
			}
			return is;
		}
function(action, thisp) {
			var is = this.initialized;
			if (arguments.length) {
				if (is) {
					action.call(thisp);
				} else {
					this._initcallbacks = this._initcallbacks || [];
					this._initcallbacks.push(function() {
						if (gui.debug) {
							try {
								action.call(thisp);
							} catch (exception) {
								console.error(action.toString());
								throw exception;
							}
						} else {
							action.call(thisp);
						}
					});
				}
			}
			return is;
		}
function ( action , thisp ) { var is = this . initialized ; if ( arguments . length ) { if ( is ) { action . call ( thisp ) ; } else { this . _initcallbacks = this . _initcallbacks || [ ] ; this . _initcallbacks . push ( function ( ) { if ( gui . debug ) { try { action . call ( thisp ) ; } catch ( exception ) { console . error ( action . toString ( ) ) ; throw exception ; } } else { action . call ( thisp ) ; } } ) ; } } return is ; }
Do something before the spirits get here.
if that's already too late, just do it now.
@param @optional {function} action
@param @optional {object} thisp
@returns {boolean} True when ready already
Do something before the spirits get here . if that s already too late just do it now .