diff --git a/jquery.modal.js b/jquery.modal.js index 1d8d752..814d22d 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -1,6 +1,6 @@ /* A simple jQuery modal (http://github.com/kylefox/jquery-modal) - Version 0.2.2 + Version 0.2.3 */ (function() { @@ -116,7 +116,7 @@ position: 'fixed', top: "50%", left: "50%", - marginTop: - (modal.elm.height() / 2), + marginTop: - (modal.elm.outerHeight() / 2), marginLeft: - (modal.elm.outerWidth() / 2), zIndex: modal.options.zIndex + 1 }); diff --git a/jquery.modal.min.js b/jquery.modal.min.js index e37c775..15c6265 100644 --- a/jquery.modal.min.js +++ b/jquery.modal.min.js @@ -1,15 +1,5 @@ /* A simple jQuery modal (http://github.com/kylefox/jquery-modal) - Version 0.2.2 + Version 0.2.3 */ -(function(){var current_modal=null;$.fn.modal=function(options){var $elm=$(this);if($elm.attr('href')){$elm.click(open_modal_from_link);return;} -options=$.extend({},$.fn.modal.defaults,options);function block(){current_modal.blocker=$('
').css({top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",position:"fixed",zIndex:options.zIndex,background:options.overlay,opacity:options.opacity});if(options.escapeClose){$(document).keydown(function(event){if(event.which==27){$.fn.modal.close();}});} -if(options.clickClose){current_modal.blocker.click($.fn.modal.close);} -$('body').append(current_modal.blocker);$elm.trigger($.fn.modal.BLOCK,[current_modal]);} -function show(){center_modal(current_modal);if(options.showClose){current_modal.closeButton=$('Close');current_modal.elm.append(current_modal.closeButton);} -$elm.addClass(options.modalClass).addClass('current').show();$elm.trigger($.fn.modal.OPEN,[current_modal]);} -current_modal={elm:$elm,options:options};$elm.trigger($.fn.modal.BEFORE_BLOCK,[current_modal]);block();$elm.trigger($.fn.modal.BEFORE_OPEN,[current_modal]);show();};$.fn.modal.defaults={overlay:"#000",opacity:0.75,zIndex:1,escapeClose:true,clickClose:true,modalClass:"modal",showClose:true};$.fn.modal.BEFORE_BLOCK='modal:before-block';$.fn.modal.BLOCK='modal:block';$.fn.modal.BEFORE_OPEN='modal:before-open';$.fn.modal.OPEN='modal:open';$.fn.modal.BEFORE_CLOSE='modal:before-close';$.fn.modal.CLOSE='modal:close';$.fn.modal.close=function(event){if(event){event.preventDefault();} -if(!current_modal){return;} -current_modal.elm.trigger($.fn.modal.BEFORE_CLOSE,[current_modal]);if(current_modal.closeButton){current_modal.closeButton.remove();} -current_modal.blocker.remove();current_modal.elm.hide();current_modal.elm.trigger($.fn.modal.CLOSE,[current_modal]);current_modal=null;};$.fn.modal.resize=function(){center_modal(current_modal);};function open_modal_from_link(event){event.preventDefault();var target=$(this).attr('href');if(target.match(/^#/)){$(target).modal();}else{$.get(target,{},function(html){$(html).appendTo('body').bind('modal:close',function(event,modal){modal.elm.remove();}).modal();});}} -function center_modal(modal){modal.elm.css({position:'fixed',top:"50%",left:"50%",marginTop:-(modal.elm.height()/2),marginLeft:-(modal.elm.outerWidth()/2),zIndex:modal.options.zIndex+1});};$('a[rel="modal:open"]').live('click',open_modal_from_link);$('a[rel="modal:close"]').live('click',$.fn.modal.close);})(); \ No newline at end of file +(function(){var a=null;$.fn.modal=function(f){var e=$(this);if(e.attr("href")){e.click(b);return}f=$.extend({},$.fn.modal.defaults,f);function g(){a.blocker=$('
').css({top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",position:"fixed",zIndex:f.zIndex,background:f.overlay,opacity:f.opacity});if(f.escapeClose){$(document).keydown(function(h){if(h.which==27){$.fn.modal.close()}})}if(f.clickClose){a.blocker.click($.fn.modal.close)}$("body").append(a.blocker);e.trigger($.fn.modal.BLOCK,[a])}function d(){c(a);if(f.showClose){a.closeButton=$('Close');a.elm.append(a.closeButton)}e.addClass(f.modalClass).addClass("current").show();e.trigger($.fn.modal.OPEN,[a])}a={elm:e,options:f};e.trigger($.fn.modal.BEFORE_BLOCK,[a]);g();e.trigger($.fn.modal.BEFORE_OPEN,[a]);d()};$.fn.modal.defaults={overlay:"#000",opacity:0.75,zIndex:1,escapeClose:true,clickClose:true,modalClass:"modal",showClose:true};$.fn.modal.BEFORE_BLOCK="modal:before-block";$.fn.modal.BLOCK="modal:block";$.fn.modal.BEFORE_OPEN="modal:before-open";$.fn.modal.OPEN="modal:open";$.fn.modal.BEFORE_CLOSE="modal:before-close";$.fn.modal.CLOSE="modal:close";$.fn.modal.close=function(d){if(d){d.preventDefault()}if(!a){return}a.elm.trigger($.fn.modal.BEFORE_CLOSE,[a]);if(a.closeButton){a.closeButton.remove()}a.blocker.remove();a.elm.hide();a.elm.trigger($.fn.modal.CLOSE,[a]);a=null};$.fn.modal.resize=function(){c(a)};function b(d){d.preventDefault();var e=$(this).attr("href");if(e.match(/^#/)){$(e).modal()}else{$.get(e,{},function(f){$(f).appendTo("body").bind("modal:close",function(h,g){g.elm.remove()}).modal()})}}function c(d){d.elm.css({position:"fixed",top:"50%",left:"50%",marginTop:-(d.elm.outerHeight()/2),marginLeft:-(d.elm.outerWidth()/2),zIndex:d.options.zIndex+1})}$('a[rel="modal:open"]').live("click",b);$('a[rel="modal:close"]').live("click",$.fn.modal.close)})(); \ No newline at end of file diff --git a/jquery.modal.pack.js b/jquery.modal.pack.js deleted file mode 100644 index 2bff4da..0000000 --- a/jquery.modal.pack.js +++ /dev/null @@ -1,5 +0,0 @@ -/* - A simple jQuery modal (http://github.com/kylefox/jquery-modal) - Version 0.2.2 -*/ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(9(){n 4=x;$.5.3=9(7){n $6=$(A);b($6.W(\'m\')){$6.j(r);B}7=$.15({},$.5.3.P,7);9 g(){4.e=$(\'\').Y({L:0,13:0,16:0,K:0,17:"Z%",I:"Z%",S:"R",f:7.f,1a:7.N,s:7.s});b(7.10){$(19).12(9(c){b(c.18==1b){$.5.3.8()}})}b(7.F){4.e.j($.5.3.8)}$(\'H\').M(4.e);$6.d($.5.3.D,[4])}9 u(){k(4);b(7.v){4.i=$(\'11\');4.6.M(4.i)}$6.V(7.X).V(\'1i\').u();$6.d($.5.3.z,[4])}4={6:$6,7:7};$6.d($.5.3.y,[4]);g();$6.d($.5.3.C,[4]);u()};$.5.3.P={N:"#1k",s:0.1m,f:1,10:q,F:q,X:"3",v:q};$.5.3.y=\'3:o-g\';$.5.3.D=\'3:g\';$.5.3.C=\'3:o-p\';$.5.3.z=\'3:p\';$.5.3.E=\'3:o-8\';$.5.3.G=\'3:8\';$.5.3.8=9(c){b(c){c.w()}b(!4){B}4.6.d($.5.3.E,[4]);b(4.i){4.i.l()}4.e.l();4.6.1o();4.6.d($.5.3.G,[4]);4=x};$.5.3.1c=9(){k(4)};9 r(c){c.w();n h=$(A).W(\'m\');b(h.1n(/^#/)){$(h).3()}1l{$.1j(h,{},9(T){$(T).1e(\'H\').1d(\'3:8\',9(c,3){3.6.l()}).3()})}}9 k(3){3.6.Y({S:\'R\',L:"J%",K:"J%",1f:-(3.6.I()/2),1g:-(3.6.1h()/2),f:3.7.f+1})};$(\'a[t="3:p"]\').O(\'j\',r);$(\'a[t="3:8"]\').O(\'j\',$.5.3.8)})();',62,87,'|||modal|current_modal|fn|elm|options|close|function||if|event|trigger|blocker|zIndex|block|target|closeButton|click|center_modal|remove|href|var|before|open|true|open_modal_from_link|opacity|rel|show|showClose|preventDefault|null|BEFORE_BLOCK|OPEN|this|return|BEFORE_OPEN|BLOCK|BEFORE_CLOSE|clickClose|CLOSE|body|height|50|left|top|append|overlay|live|defaults|div|fixed|position|html|class|addClass|attr|modalClass|css|100|escapeClose|Close|keydown|right|jquery|extend|bottom|width|which|document|background|27|resize|bind|appendTo|marginTop|marginLeft|outerWidth|current|get|000|else|75|match|hide'.split('|'),0,{}))