SimpleModal 1.3-b1 Released

SimpleModal 1.3 has been released

Considering the number of changes and new features, I’ve decided to release 1.3 as a beta version. This release covers most of the common requests I receive for SimpleModal: forced focus on the dialog (prevent tabbing away), ESC/overlay-click to close dialog and an appendTo option.

*NOTE*: Moving forward, all issue/bug/feature requests should be made on the issues page: https://code.google.com/p/simplemodal/issues/list

Download: https://code.google.com/p/simplemodal/downloads/list

Complete list of changes and new features:

  • Added appendTo option, primarily for .NET users to enable appendTo(‘form’)
  • Added focus option which forces focus to remain in the dialog
  • Added dataId option which allows a unique id to be set for the data div if one does not already exists
  • Added minHeight/minWidth options to allow minimum dimensions to be enforced
  • Added maxHeight/maxWidth options to allow maximum dimensions to be enforced. SimpleModal will always contain the modal dialog within the browser window.
  • Added escClose option to bind modal close to the ESC key
  • Added overlayClose option to bind modal close to a click on the overlay div
  • Added a wrapper div to allow for easier overflow capabilities
  • Changed meaning of close option. If false, the closeHTML, escClose and overlayClose values will be ignored.
  • Fixed auto-centering issues when container dimensions were not provided
  • Fixed Opera screen painting issues by adding .hide() before .remove()
  • Fixed Opera 9.2.x issue with jQuery 1.3.x and $(window).height()

Other than the close option, all previous options remained the same and the new options should be fairly self-explanatory.

Thanks for using SimpleModal!

20 thoughts on “SimpleModal 1.3-b1 Released”

  1. Hi,
    Great job !

    2 little corrections on your 1.3-b1 version would make it perfect.
    – Line 62, starting with a ‘;’ makes the script easier to minify and concat with others :

    ;(function ($) {
    

    – Line 326, add e.preventDefault(); before calling close function

    else if ((self.opts.close && self.opts.escClose) && e.keyCode == 27) { // ESC
    	e.preventDefault();
    	self.close();
    }
    

    In my case, a $.get in a onClose callback function was interrupted by propagation of event in case of close by ESC key whereas simple click in close box was ok. This patch corrects the trouble.

    Thanks for all, again.

  2. @Cedric – thanks for the code updates…I’ll be sure to add them to 1.3!

    @Coop – you can either set it as a global default with:

    $.modal.defaults.overlayClose = true;
    

    Or as an option:

    $(element).modal({overlayClose:true});
    
  3. Hi Eric,

    Great job!

    Say, shouldn’t 1.3 line 438 be:
    cw = this.getVal(this.dialog.container.css('width'))

    This will make my current code work with 1.3, else the container will always have the entire window’s width.

  4. @Scooper – are you seeing different results with that change? The only reason I had that for ch was due to browser differences determining height. If you have an example of how your suggestion fixes something, please let me know.

  5. overlayClose doesnt seem to work for me in the final 1.3 release…ive never been able to get it to work in any release…

  6. Hi,

    it’s a great plugin, thanks!

    I have a question : is there a way to use several modal at the same time?
    I need to use a Modal when another Modal is in use (a link in a modal open a new modal on top of the first).

    I have try the following code

    $.modal('<div>my data</div>', {});
    $.modal('<div>my data2</div>', {});

    but only the first Modal is create. So, is there a way to deal with my need.

  7. @Nico – currently, SimpleModal does not support multiple dialogs open at the same time. I’ve been getting enough requests that I’ll consider adding it in a future version.

    @John – sure, but it would require some custom coding. If you like, you contact me via email to discuss it further.

    @Srijan – the cancel button closes the dialog.

  8. Hi,
    first of all, thank you for this plugin, great work.

    Is there a way to have “send me a copy” set up a default and if where I would have to make changes.

    Right now it has to be clicked by the sender.

    Thank you in advance

  9. If you are using the WordPress plugin, you’ll need to open smcf.php and modify the checkbox code to look like:

    <input type='checkbox' id='smcf-cc' name='cc' value='1' tabindex='1005' checked='checked'/>
    
  10. Hey! it is a nice script.
    Has this script been released under LGPL??
    Can anyone use it for the commercial use also??

    Kindly confirm asap.
    Thanks 🙂

  11. @Ankit – the license terms are in included in the script. SimpleModal is released under the same terms as jQuery (dual licensed under the MIT and GPL licenses).

  12. Hi, Eric.
    First thanks for that great plugin.
    Are you expecting to do it draggable? When I open the modal I do it in the centre. If the screen size is not enough high when I scroll down I can’t see the buttons that the modal has in the bottom, any suggestion?

    Many thanks 😉
    kiumo.

  13. I’ve tried with jquery.ui draggable and it works. Just import ui.core, ui.draggable jquery scritps and make the containerId of your simplemodal draggable()!
    $(‘#confirm-container’).draggable();

    Thanks,
    kiumo

  14. Hi Eric – this is a great plugin thanks for creating and sharing it.

    I might be missing something obvious or it could well just be my HTML. I’m using the modal window for a terms and conditions ‘popup’ with a fairly lengthy amount of content, when the modal window shows it all scrolls well but starts right at the bottom of the content. Any ideas?

    Thanks in advance.

Comments are closed.

Scroll to Top