src/main/javascript/dialog/floatz.dialog.dialog.js
/**
	 * Open dialog.
	 *
	 * @param {string} url URL of HTML file to load.
	 * @param loadHandler Optional callback when loading has finished
	 */
Open dialog.
@param {string} url URL of HTML file to load.
@param loadHandler Optional callback when loading has finished
Open dialog . @param { string } url URL of HTML file to load . @param loadHandler Optional callback when loading has finished
open(url, loadHandler) {
		this._html.addClass(NO_SCROLL);
		this._body.addClass(NO_SCROLL);
		this._dialogContainer = DOM.createElement(TAG_DIV).addClass(DIALOG_CONTAINER);
		this._dialog = DOM.createElement(TAG_DIV);
		this._dialog.addClass(DIALOG)
			.load(url, (request) => {
				if (loadHandler) {
					loadHandler(request);
				}
			})
		;
		this._glass = new DialogGlass(this._dialogContainer);
		this._glass.show(() => {
			this.close();
		});
		this._dialogContainer.appendChild(this._dialog);
		this._body.appendChild(this._dialogContainer);
	}
open ( url , loadHandler ) { this . _html . addClass ( NO_SCROLL ) ; this . _body . addClass ( NO_SCROLL ) ; this . _dialogContainer = DOM . createElement ( TAG_DIV ) . addClass ( DIALOG_CONTAINER ) ; this . _dialog = DOM . createElement ( TAG_DIV ) ; this . _dialog . addClass ( DIALOG ) . load ( url , ( request ) => { if ( loadHandler ) { loadHandler ( request ) ; } } ) ; this . _glass = new DialogGlass ( this . _dialogContainer ) ; this . _glass . show ( ( ) => { this . close ( ) ; } ) ; this . _dialogContainer . appendChild ( this . _dialog ) ; this . _body . appendChild ( this . _dialogContainer ) ; }
Open dialog.
Open dialog .
// Prevent scrolling in page body while dialog is open // Create dialog and load URL // Show dialog glass // Add dialog to DOM