amoffat / bootstrap-application-wizard

MIT License
1.85k stars 388 forks source link

Disable close when clicking on background #26

Closed newtonianb closed 11 years ago

newtonianb commented 11 years ago

How do I prevent the wizard from automatically closing when the user clicks anywhere else outside the wizard. I want this as a required form completion however since a user could theoretically click outside and close this I'd like to disable this.

Alex-Sokolov commented 11 years ago

+1 for adding into plugin When initialize modal need pass some additional parameters. Now:

show: function() {
            this.log("showing");
            if (this._firstShow) {
                this.setCard(0);
                this._firstShow = false;
            }
            this.el.modal();
            return this;
        },

For disabling close when clicking on background or pressing Esc button must be:

show: function() {
            this.log("showing");
            if (this._firstShow) {
                this.setCard(0);
                this._firstShow = false;
            }
            this.el.modal({
                backdrop: 'static',
                keyboard: false
            });
            return this;
        },

From Bootstrap options: http://twitter.github.io/bootstrap/javascript.html#modals

bryancallahan commented 11 years ago

Problem resolved. Please pass in your modalOptions configuration on show(). https://github.com/amoffat/bootstrap-application-wizard/pull/29