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("").hide(),l=n._classes.box,s=a.append(n.template),i={init:function(){t("#modal-window").remove(),i._setStyle(),i._modalShow(),i._modalConent(),a.on("click","a.modal-btn",function(){i._modalBtn(t(this))}).on("click",n._classes.closebtn,function(){i._modalHide()}).click(function(t){n.closeClick&&"modal-window"==t.target.id&&i._modalHide()}),t(window).bind("keyup",i._keyUpF).resize(function(){var t=n.animate;n.animate=!1,i._position(),n.animate=t})},_setStyle:function(){a.css({position:"fixed",width:"100%",height:"100%",top:"0",left:"0","z-index":n.zIndex,overflow:"auto"}),a.find(n._classes.box).css({position:"absolute"})},_keyUpF:function(t){switch(t.keyCode){case 13:if(s.find("input:not(.modal-prompt-input),textarea").is(":focus"))return!1;i._modalBtn(a.find(n._classes.buttons+" a.modal-btn"+("undefined"!=typeof i.btnForEKey&&a.find(n._classes.buttons+" a.modal-btn:eq("+i.btnForEKey+")").size()>0?":eq("+i.btnForEKey+")":":last-child")));break;case 27:i._modalHide()}},_modalShow:function(){t("body").css({overflow:"hidden",width:t("body").innerWidth()}).append(s),null!=n.onShow?n.onShow(i.actions):null},_modalHide:function(o){if(n.closable===!1)return!1;e="undefined"==typeof e?!1:e;var s=function(){if(null!=n.callback&&"function"==typeof n.callback&&0==n.callback(e,a,i.actions)?!1:!0){a.fadeOut(200,function(){t(this).remove(),t("body").css({overflow:"",width:""})});var o=100*parseFloat(t(l).css("top"))/parseFloat(t(l).parent().css("height"));t(l).stop(!0,!0).animate({top:o+(n.animate?3:0)+"%"},"fast")}};o?setTimeout(function(){s()},o):s(),t(window).unbind("keyup",i._keyUpF)},_modalConent:function(){var e=n._classes.title,o=n._classes.content,s=n._classes.buttons,d=n.buttonText,c=["alert","confirm","prompt"],u=["xenon","atlant","reseted"];if(-1==t.inArray(n.type,c)&&"default"!=n.type&&t(l).addClass("modal-type-"+n.type),t(l).addClass(n.size&&null!=n.size?"modal-size-"+n.size:"modal-size-normal"),n.theme&&null!=n.theme&&"default"!=n.theme&&t(l).addClass((-1==t.inArray(n.theme,u)?"":"modal-theme-")+n.theme),n.background&&null!=n.background&&a.css("background-color",n.background),n.title||null!=n.title?t(e).prepend(""+n.title+"
"):t(e).remove(),"prompt"==n.type?n.text=(null!=n.text?n.text:"")+'':"",t(o).html(n.text),n.buttons||null!=n.buttons){var r="";switch(n.type){case"alert":r=''+d.ok+"";break;case"confirm":r=''+d.cancel+''+d.yes+"";break;case"prompt":r=''+d.cancel+''+d.ok+"";break;default:n.buttons.length>0&&t.isArray(n.buttons)?t.each(n.buttons,function(t,n){var e=n.addClass&&"undefined"!=typeof n.addClass?" "+n.addClass:"";r+=''+n.text+"",n.eKey&&(i.btnForEKey=t)}):r+=''+d.ok+""}t(s).html(r)}else t(s).remove();if("prompt"==n.type&&$(".modal-prompt-input").focus(),n.autoclose){var m=n.buttons||null!=n.buttons?32*t(o).text().length:900;i._modalHide(900>m?900:m)}a.fadeIn(200),i._position()},_position:function(){var e,o,a;n.center?(e={top:t(window).height()-1)e=l=1==d?!0:!1,"prompt"==s&&(e=l=l&&a.find("input.modal-prompt-input").size()>0!=0?a.find("input.modal-prompt-input").val():!1),i._modalHide();else{if(o.hasClass("btn-disabled"))return!1;e=l=c&&c.val?c.val:!0,(!c.onClick||c.onClick(t.extend({val:l,bObj:o,bOpts:c},i.actions)))&&i._modalHide()}e=l},actions:{html:a,close:function(){i._modalHide()},getModal:function(){return a},getBox:function(){return a.find(n._classes.box)},getInner:function(){return a.find(n._classes.boxInner)},getTitle:function(){return a.find(n._classes.title)},getContet:function(){return a.find(n._classes.content)},getButtons:function(){return a.find(n._classes.buttons).find("a")},setTitle:function(t){return a.find(n._classes.title+" h3").html(t),a.find(n._classes.title+" h3").size()>0},setContent:function(t){return a.find(n._classes.content).html(t),a.find(n._classes.content).size()>0}}};return i.init(),i.actions}}(jQuery);
\ No newline at end of file
+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:null,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("").hide(),l=n._classes.box,s=a.append(n.template),i={init:function(){t("#modal-window").remove(),i._setStyle(),i._modalShow(),i._modalConent(),a.on("click","a.modal-btn",function(){i._modalBtn(t(this))}).on("click",n._classes.closebtn,function(){e=!1,i._modalHide()}).click(function(t){n.closeClick&&"modal-window"==t.target.id&&(e=!1,i._modalHide())}),t(window).bind("keyup",i._keyUpF).resize(function(){var t=n.animate;n.animate=!1,i._position(),n.animate=t})},_setStyle:function(){a.css({position:"fixed",width:"100%",height:"100%",top:"0",left:"0","z-index":n.zIndex,overflow:"auto"}),a.find(n._classes.box).css({position:"absolute"})},_keyUpF:function(t){switch(t.keyCode){case 13:if(s.find("input:not(.modal-prompt-input),textarea").is(":focus"))return!1;i._modalBtn(a.find(n._classes.buttons+" a.modal-btn"+("undefined"!=typeof i.btnForEKey&&a.find(n._classes.buttons+" a.modal-btn:eq("+i.btnForEKey+")").size()>0?":eq("+i.btnForEKey+")":":last-child")));break;case 27:i._modalHide()}},_modalShow:function(){t("body").css({overflow:"hidden",width:t("body").innerWidth()}).append(s)},_modalHide:function(o){if(n.closable===!1)return!1;e="undefined"==typeof e?!1:e;var s=function(){if(null!=n.callback&&"function"==typeof n.callback&&0==n.callback(e,a,i.actions)?!1:!0){a.fadeOut(200,function(){t(this).remove(),t("body").css({overflow:"",width:""})});var o=100*parseFloat(t(l).css("top"))/parseFloat(t(l).parent().css("height"));t(l).stop(!0,!0).animate({top:o+(n.animate?3:0)+"%"},"fast")}};o?setTimeout(function(){s()},o):s(),t(window).unbind("keyup",i._keyUpF)},_modalConent:function(){var e=n._classes.title,o=n._classes.content,s=n._classes.buttons,d=n.buttonText,c=["alert","confirm","prompt"],u=["xenon","atlant","reseted"];if(-1==t.inArray(n.type,c)&&"default"!=n.type&&t(l).addClass("modal-type-"+n.type),t(l).addClass(n.size&&null!=n.size?"modal-size-"+n.size:"modal-size-normal"),n.theme&&null!=n.theme&&"default"!=n.theme&&t(l).addClass((-1==t.inArray(n.theme,u)?"":"modal-theme-")+n.theme),n.background&&null!=n.background&&a.css("background-color",n.background),n.title||null!=n.title?t(e).prepend(""+n.title+"
"):t(e).remove(),"prompt"==n.type?n.text=(null!=n.text?n.text:"")+'':"",t(o).html(n.text),n.buttons||null!=n.buttons){var r="";switch(n.type){case"alert":r=''+d.ok+"";break;case"confirm":r=''+d.cancel+''+d.yes+"";break;case"prompt":r=''+d.cancel+''+d.ok+"";break;default:n.buttons.length>0&&t.isArray(n.buttons)?t.each(n.buttons,function(t,n){var e=n.addClass&&"undefined"!=typeof n.addClass?" "+n.addClass:"";r+=''+n.text+"",n.eKey&&(i.btnForEKey=t)}):r+=''+d.ok+""}t(s).html(r)}else t(s).remove();if("prompt"==n.type&&$(".modal-prompt-input").focus(),n.autoclose){var m=n.buttons||null!=n.buttons?32*t(o).text().length:900;i._modalHide(900>m?900:m)}a.fadeIn(200,function(){null!=n.onShow?n.onShow(i.actions):null}),i._position()},_position:function(){var e,o,a;n.center?(e={top:t(window).height()-1)e=l=1==d?!0:!1,"prompt"==s&&(e=l=l&&a.find("input.modal-prompt-input").size()>0!=0?a.find("input.modal-prompt-input").val():!1),i._modalHide();else{if(o.hasClass("btn-disabled"))return!1;e=l=c&&c.val?c.val:!0,(!c.onClick||c.onClick(t.extend({val:l,bObj:o,bOpts:c},i.actions)))&&i._modalHide()}e=l},actions:{html:a,close:function(){i._modalHide()},getModal:function(){return a},getBox:function(){return a.find(n._classes.box)},getInner:function(){return a.find(n._classes.boxInner)},getTitle:function(){return a.find(n._classes.title)},getContet:function(){return a.find(n._classes.content)},getButtons:function(){return a.find(n._classes.buttons).find("a")},setTitle:function(t){return a.find(n._classes.title+" h3").html(t),a.find(n._classes.title+" h3").size()>0},setContent:function(t){return a.find(n._classes.content).html(t),a.find(n._classes.content).size()>0}}};return i.init(),i.actions}}(jQuery);
\ No newline at end of file