diff --git a/README.md b/README.md index 5a51d29..322396d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -jquery.modal 1.2.3 +jQuery.modal 1.2.3 ============ A simple jQuery Modal plugin. -Demo | Documentation +Demo | Documentation Usage ------- @@ -84,7 +84,7 @@ Options * __closeClick__ On click near the modal box, close it * __closable__ Enable Modal closing * __animate__ Enable slide Animation -* __theme__ Custom class for your modal (xenon | atlant | reseted) +* __theme__ Custom class for your modal (default | xenon | atlant | reseted) * __background__ Background Color of modal overlay * __zIndex__ Modal z-index * __buttonText__ Custom text for alert, confirm and prompt modals diff --git a/css/jquery.modal.css b/css/jquery.modal.css index 9bb8af5..8245813 100644 --- a/css/jquery.modal.css +++ b/css/jquery.modal.css @@ -13,6 +13,7 @@ border: 0; font-size: 100%; font: inherit; + line-height: normal; vertical-align: baseline; } diff --git a/js/jquery.modal.js b/js/jquery.modal.js index 655585b..3884e1c 100644 --- a/js/jquery.modal.js +++ b/js/jquery.modal.js @@ -29,7 +29,7 @@ function modal(e) { closeClick: true, closable: true, theme: "default", - background: "rgba(0,0,0,0.35)", + background: null, zIndex: 1050, buttonText: { ok: "OK", @@ -59,10 +59,12 @@ function modal(e) { i.on("click", "a.modal-btn", function(t) { u._modalBtn(e(this)) }).on("click", t._classes.closebtn, function(e) { + r = false; u._modalHide() }).click(function(e) { if (t.closeClick) { if (e.target.id == "modal-window") { + r = false; u._modalHide() } } @@ -106,7 +108,6 @@ function modal(e) { overflow: "hidden", width: e("body").innerWidth() }).append(o); - t.onShow != null ? t.onShow(u.actions) : null; }, _modalHide: function(n) { if (t.closable === false) { @@ -201,7 +202,9 @@ function modal(e) { var h = t.buttons || t.buttons != null ? e(r).text().length * 32 : 900; u._modalHide(h < 900 ? 900 : h) } - i.fadeIn(200); + i.fadeIn(200, function(){ + t.onShow != null ? t.onShow(u.actions) : null; + }); u._position(); }, _position: function() { @@ -299,4 +302,4 @@ function modal(e) { u.init(); return u.actions; } -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/js/jquery.modal.min.js b/js/jquery.modal.min.js index b1bb3b2..8de7cba 100644 --- a/js/jquery.modal.min.js +++ b/js/jquery.modal.min.js @@ -5,4 +5,4 @@ * Version: 1.2.3 (10-04-2015) * Requires: jQuery v1.7.1 or later */ -function modal(t){return $.cModal(t)}!function(t){t.cModal=function(n){var e,o={type:"default",title:null,text:null,size:"normal",buttons:[{text:"OK",val:!0,onClick:function(){return!0}}],center:!0,autoclose:!1,callback:null,onShow:null,animate:!0,closeClick:!0,closable:!0,theme:"default",background:"rgba(0,0,0,0.35)",zIndex:1050,buttonText:{ok:"OK",yes:"Yes",cancel:"Cancel"},template:'',_classes:{box:".modal-box",boxInner:".modal-inner",title:".modal-title",content:".modal-text",buttons:".modal-buttons",closebtn:".modal-close-btn"}},n=t.extend({},o,n),a=t("