Skip to content

clicking anywhere inside of the dialog closes it #1

@sbisker

Description

@sbisker

can be replicated on the demo example. this appears to be because the entire dialog is wrapped inside of the "modal-backdrop" div, and both your code and bootstrap have the following code for sending backdrop clicks, which doesn't distinguish between a direct div click and clicks of its children

if ( this.settings.backdrop != 'static' ) {
this.$backdrop.click($.proxy(this.hide, this))
}

i've tried my hand at limiting the target of the code using direct identification on the target, but my scoping of "this" isn't quite right, so no luck yet...:
if (this.options.backdrop != 'static') {
this.$backdrop.click(function(e){
/* Added by Sol - need to target just the outer backdrop to close, not inner children */
if (e.target.className == "modal-backdrop in")
{
$.proxy(this.hide, this)();
}
})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions