diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index 6dbb7ca..6a698ee 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -728,28 +728,28 @@
if (this.progress.url) {
progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
}
- this.progress.element = $(progressBar.element).addClass('ajax-progress ajax-progress-bar');
+ this.progress.$element = progressBar.$element.addClass('ajax-progress ajax-progress-bar');
this.progress.object = progressBar;
- $(this.element).after(this.progress.element);
+ $(this.element).after(this.progress.$element);
};
/**
* Sets the throbber progress indicator.
*/
Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
- this.progress.element = $('
');
+ this.progress.$element = $('');
if (this.progress.message) {
- this.progress.element.find('.throbber').after('' + this.progress.message + '
');
+ this.progress.$element.find('.throbber').after('' + this.progress.message + '
');
}
- $(this.element).after(this.progress.element);
+ $(this.element).after(this.progress.$element);
};
/**
* Sets the fullscreen progress indicator.
*/
Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
- this.progress.element = $('
');
- $('body').after(this.progress.element);
+ this.progress.$element = $('
');
+ $('body').after(this.progress.$element);
};
/**
@@ -760,8 +760,8 @@
*/
Drupal.Ajax.prototype.success = function (response, status) {
// Remove the progress element.
- if (this.progress.element) {
- $(this.progress.element).remove();
+ if (this.progress.$element) {
+ $(this.progress.$element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
@@ -857,8 +857,8 @@
*/
Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
// Remove the progress element.
- if (this.progress.element) {
- $(this.progress.element).remove();
+ if (this.progress.$element) {
+ $(this.progress.$element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
diff --git a/core/misc/batch.js b/core/misc/batch.js
index 411badb..d5b6990 100644
--- a/core/misc/batch.js
+++ b/core/misc/batch.js
@@ -38,7 +38,7 @@
// Remove HTML from no-js progress bar.
$progress.empty();
// Append the JS progressbar element.
- $progress.append(progressBar.element);
+ $progress.append(progressBar.$element);
}
}
};
diff --git a/core/misc/progress.js b/core/misc/progress.js
index 2675751..00ca978 100644
--- a/core/misc/progress.js
+++ b/core/misc/progress.js
@@ -26,14 +26,14 @@
/**
* A progressbar object. Initialized with the given id. Must be inserted into
- * the DOM afterwards through progressBar.element.
+ * the DOM afterwards through progressBar.$element.
*
* Method is the function which will perform the HTTP request to get the
* progress bar state. Either "GET" or "POST".
*
* @example
* pb = new Drupal.ProgressBar('myProgressBar');
- * some_element.appendChild(pb.element);
+ * $someElement.appendChild(pb.$element);
*
* @constructor
*
@@ -48,11 +48,23 @@
this.updateCallback = updateCallback;
this.errorCallback = errorCallback;
- // The WAI-ARIA setting aria-live="polite" will announce changes after
- // users
- // have completed their current activity and not interrupt the screen
- // reader.
- this.element = $(Drupal.theme('progressBar', id));
+ // The WAI-ARIA setting aria-live="polite" will announce changes after users
+ // have completed their current activity and not interrupt the screen reader.
+
+ this.$element = $(Drupal.theme('progressBar', id));
+
+ // this.$element = $('').attr('id', id);
+ this.$progressLabel = this.$element.find('.progress__label');
+ this.$progressTrack = this.$element.find('.progress__track');
+ this.$progressPercentage = this.$element.find('.progress__percentage');
+ this.$progressDescription = this.$element.find('.progress__description');
+ this.$progressBar = this.$progressTrack.children();
+
+ this.$element
+ .append(this.$progressLabel)
+ .append(this.$progressTrack)
+ .append(this.$progressPercentage)
+ .append(this.$progressDescription);
};
$.extend(Drupal.ProgressBar.prototype, /** @lends Drupal.ProgressBar# */{
@@ -66,11 +78,11 @@
*/
setProgress: function (percentage, message, label) {
if (percentage >= 0 && percentage <= 100) {
- $(this.element).find('div.progress__bar').css('width', percentage + '%');
- $(this.element).find('div.progress__percentage').html(percentage + '%');
+ this.$progressBar.css('width', percentage + '%');
+ this.$progressPercentage.html(percentage + '%');
}
- $('div.progress__description', this.element).html(message);
- $('div.progress__label', this.element).html(label);
+ this.$progressDescription.html(message);
+ this.$progressLabel.html(label);
if (this.updateCallback) {
this.updateCallback(percentage, message, this);
}
@@ -146,8 +158,8 @@
* @param {string} string
*/
displayError: function (string) {
- var error = $('').html(string);
- $(this.element).before(error).hide();
+ var errorMarkup = '' + string + '
';
+ this.$element.before(errorMarkup).hide();
if (this.errorCallback) {
this.errorCallback(this);