private _init()

in scripts/view.ts [16:80]


    private _init(): void {
        // remove the existing container from body before continuing
        $(".container").remove();

        var container = $("<div />");
        container.addClass("container");

        var wrap = $("<div />");
        wrap.addClass("wrap combo emptyBorder");

        var hitcount = $("<input />").attr("type", "number");
        wrap.append(hitcount);

        this.currentValue = String(this.model.getCurrentValue());

        hitcount.val(this.currentValue);
        hitcount.attr("aria-valuenow", this.currentValue);
        hitcount.change(() => {
            this._inputChanged();
        }).on("keydown", (evt: JQueryKeyEventObject) => {
            if (evt.keyCode === 38) {
                if (this.onUpTick) {
                    this.onUpTick();
                    evt.preventDefault();
                }
            } else if (evt.keyCode === 40) {
                if (this.onDownTick) {
                    this.onDownTick();
                    evt.preventDefault();
                }
            }
        });

        var uptick = $("<div />");
        uptick.addClass("bowtie-icon bowtie-math-plus-box");
        uptick.hide();
        uptick.click(() => {
            this.onUpTick();
        });

        var downtick = $("<div />");
        downtick.addClass("bowtie-icon bowtie-math-minus-box");
        downtick.hide();
        downtick.click(() => {
            this.onDownTick();
        });

        container.append(wrap);
        container.append(downtick);
        container.append(uptick);

        container.hover(() => {
            wrap.addClass("border");
            downtick.show();
            uptick.show();
        }, () => {
            if (!hitcount.is(":focus")) {
                wrap.removeClass("border");
                downtick.hide();
                uptick.hide();
            }
        });

        $("body").append(container);
    }