diff --git a/js/src/quantity-selector.js b/js/src/quantity-selector.js index b8ea0f5fc6..afcf935e90 100644 --- a/js/src/quantity-selector.js +++ b/js/src/quantity-selector.js @@ -132,6 +132,22 @@ class QuantitySelector extends BaseComponent { btnUp.setAttribute('disabled', '') } } + + static jQueryInterface(config) { + return this.each(function () { + const data = QuantitySelector.getOrCreateInstance(this, config) + + if (typeof config !== 'string') { + return + } + + if (typeof data[config] === 'undefined') { + throw new TypeError(`No method named "${config}"`) + } + + data[config]() + }) + } } /**