CoreFiles by mySites.guru
toolbar.js52 lines, 1,513 bytes, from Joomla_4.0.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta2
md5
0f3ca24bca80c43cc7c9e550657316d2
sha1
57d5ed21c1d35b63e22c14711bedbf11ab381308
sha256
1f61e083629543594690d832cbe6d94022a506945ab83d7261a46cad75591fcd
/**
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

Joomla = window.Joomla || {};

(function(Joomla, document) {
	'use strict';

	/**
	 * USED IN: libraries/joomla/html/toolbar/button/help.php
	 *
	 * Pops up a new window in the middle of the screen
	 *
	 * @param {string}  mypage  The URL for the redirect
	 * @param {string}  myname  The name of the page
	 * @param {int}     w       The width of the new window
	 * @param {int}     h       The height of the new window
	 * @param {string}  scroll  The vertical/horizontal scroll bars
	 *
	 * @since 4.0.0
	 */
	Joomla.popupWindow = function(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2,
		    wint = (screen.height - h) / 2,
		    winprops = 'height=' + h +
			    ',width=' + w +
			    ',top=' + wint +
			    ',left=' + winl +
			    ',scrollbars=' + scroll +
			    ',resizable';

		window.open(mypage, myname, winprops).window.focus();
	};

	document.addEventListener('DOMContentLoaded', function() {
		/**
		 * Fix the alignment of the Options and Help toolbar buttons
		 */
		var toolbarOptions = document.getElementById('toolbar-options'),
		    toolbarHelp = document.getElementById('toolbar-help');

		if (toolbarHelp && !toolbarOptions) {
			toolbarHelp.classList.add('ml-auto');
		}
		if (toolbarOptions && !toolbarHelp) {
			toolbarOptions.classList.add('ml-auto');
		}

	});
})(Joomla, document);

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.