Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

jquery modal plug-in not really modal

The following is the first few lines of my jquery plug-in.

It creates the modal dialog, but when the user clicks the shaded webpage [that contains the plug-in], the pop-up disappears.

How do I make any click outside the plug-in's pop-up get  ignored?

Thanks

(function ($, window, document, undefined) {

    window.wsi = window.wsi || {};
    window.wsi.widgets = window.wsi.widgets || {};
    self.tabDirtyId = undefined;
    self.tabClickedId = undefined;

    var configSelectorDialog = function (element, options) {
        this.element = element;
        this.options = $.extend({}, this.defaults, options);
    };

    configSelectorDialog.prototype = {
        // defaults: defines default values for user options
        defaults: {
            title: '',
            customerStationCatalogListType: '',
            maxNbrLists: 0, /*optional*/
            maxNbrSites: 0, /*optional*/
            onDone: function () { } /*optional*/
        },
        init: function () {
            this.create();
        }
    };

Open in new window

Avatar of mankowitz
mankowitz
Flag of United States of America image

I don't see where you instantiate the dialog here, but you can override the close event with something like this.

$("#dialog").dialog({
   beforeClose: function(){
     return false;
   }
});
Avatar of curiouswebster

ASKER

I forgot to say, I use Bootstrap.

Is there a Bootstrap event I should use instead for this?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks
You are welcome.