CoreFiles by mySites.guru
admin-articles-default-batch-footer.js33 lines, 903 bytes, from Joomla_6.0.2-Stable-Full_Package.zip
Raw History Compare with 6.0.1
md5
f728b585f0310f46fb2355a13d578e85
sha1
b5c1337551cb97951475fbaa49b090b3efebc7f3
sha256
f92ba5ab612fefa89b2465238bfca2d46f3541901ee19d953b4545c3b62968bc
/**
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
((document, submitForm) => {

  // Selectors used by this script
  const buttonDataSelector = 'data-submit-task';
  const formId = 'adminForm';

  /**
   * Submit the task
   * @param task
   */
  const submitTask = task => {
    const form = document.getElementById(formId);
    if (form && task === 'article.batch') {
      submitForm(task, form);
    }
  };

  // Register events
  document.addEventListener('DOMContentLoaded', () => {
    const button = document.getElementById('batch-submit-button-id');
    if (button) {
      button.addEventListener('click', e => {
        const task = e.target.getAttribute(buttonDataSelector);
        submitTask(task);
        return false;
      });
    }
  });
})(document, Joomla.submitform);

The same content is in 214 releases, Joomla 4.3.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.