Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating with HTML string does not center the dialog #32

Open
sangwook-kim opened this issue Jun 28, 2013 · 0 comments
Open

creating with HTML string does not center the dialog #32

sangwook-kim opened this issue Jun 28, 2013 · 0 comments

Comments

@sangwook-kim
Copy link

You can create with
$.modal($('

asdf

));
$.modal(asdf);
$.modal(123);

however, if you create the modal like below,
$.modal('

asdf

);
the dialog's top-left point will be placed at the center. not to body of dialog.

so if you apply patch below,
@@ -231,6 +231,7 @@
*/
init: function (data, options) {
var s = this;

  •       var testData = null;
    
        // don't allow multiple calls
        if (s.d.data) {
    

    @@ -270,6 +271,9 @@
    }
    }
    }

  •       else if (typeof data === 'string' && (testData = $(data)).length > 0) {
    
  •           data = testData;
    
  •       }
        else if (typeof data === 'string' || typeof data === 'number') {
            // just insert the data as innerHTML
            data = $('<div></div>').html(data);
    

You can use HTML string as data.

Sorry for the sloppy patch.
It's my first patch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant