simplemodal icon indicating copy to clipboard operation
simplemodal copied to clipboard

creating with HTML string does not center the dialog

Open sangwook-kim opened this issue 11 years ago • 0 comments

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...

sangwook-kim avatar Jun 28 '13 02:06 sangwook-kim