summaryrefslogtreecommitdiff
path: root/vendor/oojs/oojs-ui/src/elements/PendingElement.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
commita2190ac74dd4d7080b12bab90e552d7aa81209ef (patch)
tree8b31f38de9882d18df54cf8d9e0de74167a094eb /vendor/oojs/oojs-ui/src/elements/PendingElement.js
parent15e69f7b20b6596b9148030acce5b59993b95a45 (diff)
parent257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff)
Merge branch 'mw-1.26'
Diffstat (limited to 'vendor/oojs/oojs-ui/src/elements/PendingElement.js')
-rw-r--r--vendor/oojs/oojs-ui/src/elements/PendingElement.js84
1 files changed, 0 insertions, 84 deletions
diff --git a/vendor/oojs/oojs-ui/src/elements/PendingElement.js b/vendor/oojs/oojs-ui/src/elements/PendingElement.js
deleted file mode 100644
index c5f71d54..00000000
--- a/vendor/oojs/oojs-ui/src/elements/PendingElement.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Element that can be marked as pending.
- *
- * @abstract
- * @class
- *
- * @constructor
- * @param {Object} [config] Configuration options
- * @cfg {jQuery} [$pending] Element to mark as pending, defaults to this.$element
- */
-OO.ui.PendingElement = function OoUiPendingElement( config ) {
- // Configuration initialization
- config = config || {};
-
- // Properties
- this.pending = 0;
- this.$pending = null;
-
- // Initialisation
- this.setPendingElement( config.$pending || this.$element );
-};
-
-/* Setup */
-
-OO.initClass( OO.ui.PendingElement );
-
-/* Methods */
-
-/**
- * Set the pending element (and clean up any existing one).
- *
- * @param {jQuery} $pending The element to set to pending.
- */
-OO.ui.PendingElement.prototype.setPendingElement = function ( $pending ) {
- if ( this.$pending ) {
- this.$pending.removeClass( 'oo-ui-pendingElement-pending' );
- }
-
- this.$pending = $pending;
- if ( this.pending > 0 ) {
- this.$pending.addClass( 'oo-ui-pendingElement-pending' );
- }
-};
-
-/**
- * Check if input is pending.
- *
- * @return {boolean}
- */
-OO.ui.PendingElement.prototype.isPending = function () {
- return !!this.pending;
-};
-
-/**
- * Increase the pending stack.
- *
- * @chainable
- */
-OO.ui.PendingElement.prototype.pushPending = function () {
- if ( this.pending === 0 ) {
- this.$pending.addClass( 'oo-ui-pendingElement-pending' );
- this.updateThemeClasses();
- }
- this.pending++;
-
- return this;
-};
-
-/**
- * Reduce the pending stack.
- *
- * Clamped at zero.
- *
- * @chainable
- */
-OO.ui.PendingElement.prototype.popPending = function () {
- if ( this.pending === 1 ) {
- this.$pending.removeClass( 'oo-ui-pendingElement-pending' );
- this.updateThemeClasses();
- }
- this.pending = Math.max( 0, this.pending - 1 );
-
- return this;
-};