X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmisc%2Fbatch.js;h=83ecf5a748357918439b1d5f5be7d4e801875c4a;hb=74df008bdbb3a11eeea356744f39b802369bda3c;hp=411badba4272ef1756e901cb294deb8f93ce2248;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/misc/batch.js b/web/core/misc/batch.js index 411badba4..83ecf5a74 100644 --- a/web/core/misc/batch.js +++ b/web/core/misc/batch.js @@ -1,24 +1,17 @@ /** - * @file - * Drupal's batch API. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function ($, Drupal) { - - 'use strict'; - - /** - * Attaches the batch behavior to progress bars. - * - * @type {Drupal~behavior} - */ Drupal.behaviors.batch = { - attach: function (context, settings) { + attach: function attach(context, settings) { var batch = settings.batch; var $progress = $('[data-drupal-progress]').once('batch'); - var progressBar; + var progressBar = void 0; - // Success: redirect to the summary. function updateCallback(progress, status, pb) { if (progress === '100') { pb.stopMonitoring(); @@ -35,12 +28,11 @@ progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback); progressBar.setProgress(-1, batch.initMessage); progressBar.startMonitoring(batch.uri + '&op=do', 10); - // Remove HTML from no-js progress bar. + $progress.empty(); - // Append the JS progressbar element. + $progress.append(progressBar.element); } } }; - -})(jQuery, Drupal); +})(jQuery, Drupal); \ No newline at end of file