constructor(options) {
        options.$element.html('<input type="text" size="1" ' +
            'class="ui-widget-content ui-corner-all"/>');

        const self = this,
            $spinner = options.$element.find('input');
        this.value = options.init;
        $spinner.spinner({
            min: options.min,
            max: options.max,
            step: options.step,
            spin: function(event, ui) {
                /*jshint unused:true */
                self.value = ui.value;
                options.updateCallback(self.value);
            }
        });
        $spinner.val(this.value);
        $spinner.keyup(function(e) {
            if (e.which === 13) {
                if (!this.value.match(/^-?\d?\.?\d*$/)) {
                    this.value = options.init;
                } else if (options.min !== undefined &&
                    this.value < options.min) {
                    this.value = options.min;
                } else if (options.max !== undefined &&
                    this.value > options.max) {
                    this.value = options.max;
                }
                self.value = this.value;
                options.updateCallback(self.value);
            }
        });

    }
This class is an improvement over the basic jQuery spinner to support
'Enter' to update the value (with validity checks).
@param {Object} options Options object
@return {Spinner} A spinner object