Mercurial > hg > isophonics-drupal-site
comparison core/misc/batch.es6.js @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 /** | 1 /** |
2 * @file | 2 * @file |
3 * Drupal's batch API. | 3 * Drupal's batch API. |
4 */ | 4 */ |
5 | 5 |
6 (function ($, Drupal) { | 6 (function($, Drupal) { |
7 /** | 7 /** |
8 * Attaches the batch behavior to progress bars. | 8 * Attaches the batch behavior to progress bars. |
9 * | 9 * |
10 * @type {Drupal~behavior} | 10 * @type {Drupal~behavior} |
11 */ | 11 */ |
27 $progress.prepend($('<p class="error"></p>').html(batch.errorMessage)); | 27 $progress.prepend($('<p class="error"></p>').html(batch.errorMessage)); |
28 $('#wait').hide(); | 28 $('#wait').hide(); |
29 } | 29 } |
30 | 30 |
31 if ($progress.length) { | 31 if ($progress.length) { |
32 progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback); | 32 progressBar = new Drupal.ProgressBar( |
33 'updateprogress', | |
34 updateCallback, | |
35 'POST', | |
36 errorCallback, | |
37 ); | |
33 progressBar.setProgress(-1, batch.initMessage); | 38 progressBar.setProgress(-1, batch.initMessage); |
34 progressBar.startMonitoring(`${batch.uri}&op=do`, 10); | 39 progressBar.startMonitoring(`${batch.uri}&op=do`, 10); |
35 // Remove HTML from no-js progress bar. | 40 // Remove HTML from no-js progress bar. |
36 $progress.empty(); | 41 $progress.empty(); |
37 // Append the JS progressbar element. | 42 // Append the JS progressbar element. |
38 $progress.append(progressBar.element); | 43 $progress.append(progressBar.element); |
39 } | 44 } |
40 }, | 45 }, |
41 }; | 46 }; |
42 }(jQuery, Drupal)); | 47 })(jQuery, Drupal); |