[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/legacy/js/ -> toolbar.js (source)

   1  /**
   2   * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
   3   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   4   */
   5  
   6  Joomla = window.Joomla || {};
   7  
   8  (function (Joomla, document) {
   9    'use strict';
  10  
  11    /**
  12     * USED IN: libraries/joomla/html/toolbar/button/help.php
  13     *
  14     * Pops up a new window in the middle of the screen
  15     *
  16     * @param {string}  mypage  The URL for the redirect
  17     * @param {string}  myname  The name of the page
  18     * @param {int}     w       The width of the new window
  19     * @param {int}     h       The height of the new window
  20     * @param {string}  scroll  The vertical/horizontal scroll bars
  21     *
  22     * @since 4.0.0
  23     */
  24    Joomla.popupWindow = function (mypage, myname, w, h, scroll) {
  25      const winl = (screen.width - w) / 2;
  26      const wint = (screen.height - h) / 2;
  27      const winprops = `height=$h},width=$w},top=$wint},left=$winl},scrollbars=$scroll},resizable`;
  28  
  29      window.open(mypage, myname, winprops).window.focus();
  30    };
  31  
  32    document.addEventListener('DOMContentLoaded', () => {
  33      /**
  34       * Fix the alignment of the Options and Help toolbar buttons
  35       */
  36      const toolbarOptions = document.getElementById('toolbar-options');
  37      const toolbarHelp = document.getElementById('toolbar-help');
  38      const toolbarInlineHelp = document.getElementById('toolbar-inlinehelp');
  39  
  40      if (toolbarInlineHelp) {
  41        toolbarInlineHelp.classList.add('ms-auto');
  42        return;
  43      }
  44  
  45      if (toolbarHelp && !toolbarOptions) {
  46        toolbarHelp.classList.add('ms-auto');
  47      }
  48  
  49      if (toolbarOptions && !toolbarHelp) {
  50        toolbarOptions.classList.add('ms-auto');
  51      }
  52    });
  53  }(Joomla, document));


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer