From 25d556e4d4aa7b41254e8d8dedb3eb60690fb70a Mon Sep 17 00:00:00 2001 From: VodkaBears Date: Thu, 19 Feb 2015 14:36:57 +0300 Subject: [PATCH] Release v0.6.1 --- CHANGELOG.md | 3 +++ bower.json | 2 +- dist/jquery.remodal.css | 2 +- dist/jquery.remodal.js | 10 +++++----- dist/jquery.remodal.min.js | 4 ++-- remodal.jquery.json | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccd0a82..ef1aa51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.6.1 +* Fix '#on' event handlers. + ### 0.6.0 * Added globals. * Added the ability to change the namespace for CSS and events. diff --git a/bower.json b/bower.json index 1326d5d..ce1b742 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "remodal", - "version": "0.6.0", + "version": "0.6.1", "homepage": "http://vodkabears.github.io/remodal/", "authors": [ "Ilya Makarov " diff --git a/dist/jquery.remodal.css b/dist/jquery.remodal.css index d1f5d7d..97971b9 100644 --- a/dist/jquery.remodal.css +++ b/dist/jquery.remodal.css @@ -1,5 +1,5 @@ /* - * Remodal - v0.6.0 + * Remodal - v0.6.1 * Flat, responsive, lightweight, easy customizable modal window plugin with declarative state notation and hash tracking. * http://vodkabears.github.io/remodal/ * diff --git a/dist/jquery.remodal.js b/dist/jquery.remodal.js index 066a437..b00df4f 100644 --- a/dist/jquery.remodal.js +++ b/dist/jquery.remodal.js @@ -1,5 +1,5 @@ /* - * Remodal - v0.6.0 + * Remodal - v0.6.1 * Flat, responsive, lightweight, easy customizable modal window plugin with declarative state notation and hash tracking. * http://vodkabears.github.io/remodal/ * @@ -223,14 +223,14 @@ remodal.td = tdBg > remodal.td ? tdBg : remodal.td; // Add close button event listener - remodal.$wrapper.on("click." + namespace, remodal.$closeButton.selector, function(e) { + remodal.$wrapper.on("click." + namespace, "." + namespace + "-close", function(e) { e.preventDefault(); remodal.close(); }); // Add cancel button event listener - remodal.$wrapper.on("click." + namespace, remodal.$cancelButton.selector, function(e) { + remodal.$wrapper.on("click." + namespace, "." + namespace + "-cancel", function(e) { e.preventDefault(); remodal.$modal.trigger("cancel"); @@ -241,7 +241,7 @@ }); // Add confirm button event listener - remodal.$wrapper.on("click." + namespace, remodal.$confirmButton.selector, function(e) { + remodal.$wrapper.on("click." + namespace, "." + namespace + "-confirm", function(e) { e.preventDefault(); remodal.$modal.trigger("confirm"); @@ -252,7 +252,7 @@ }); // Add keyboard event listener - $(document).bind("keyup." + namespace, function(e) { + $(document).on("keyup." + namespace, function(e) { if (e.keyCode === 27 && remodal.settings.closeOnEscape) { remodal.close(); } diff --git a/dist/jquery.remodal.min.js b/dist/jquery.remodal.min.js index a7d862f..04f7310 100644 --- a/dist/jquery.remodal.min.js +++ b/dist/jquery.remodal.min.js @@ -1,9 +1,9 @@ /* - * Remodal - v0.6.0 + * Remodal - v0.6.1 * Flat, responsive, lightweight, easy customizable modal window plugin with declarative state notation and hash tracking. * http://vodkabears.github.io/remodal/ * * Made by Ilya Makarov * Under MIT License */ -!function(a){"use strict";function b(a){var b,c,d,e,f=a.css("transition-duration")||a.css("-webkit-transition-duration")||a.css("-moz-transition-duration")||a.css("-o-transition-duration")||a.css("-ms-transition-duration")||"0s",g=a.css("transition-delay")||a.css("-webkit-transition-delay")||a.css("-moz-transition-delay")||a.css("-o-transition-delay")||a.css("-ms-transition-delay")||"0s";for(f=f.split(", "),g=g.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;c>e;e++)d=parseFloat(f[e])+parseFloat(g[e]),d>b&&(b=d);return 1e3*d}function c(){if(a(document.body).height()<=a(window).height())return 0;var b,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),b=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),b-c}function d(){var b,d,e=a("html"),f=l+"-is-locked";e.hasClass(f)||(b=a(document.body),d=parseInt(b.css("padding-right"),10)+c(),b.css("padding-right",d+"px"),e.addClass(f))}function e(){var b,d,e=a("html"),f=l+"-is-locked";e.hasClass(f)&&(b=a(document.body),d=parseInt(b.css("padding-right"),10)-c(),b.css("padding-right",d+"px"),e.removeClass(f))}function f(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;c>e;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||("false"===d?!1:d)),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function g(c,d){var e,f,g,h=this;h.settings=a.extend({},m,d),h.$body=a(document.body),h.$overlay=a("."+l+"-overlay"),h.$overlay.length||(h.$overlay=a("
").addClass(l+"-overlay"),h.$body.append(h.$overlay)),h.$bg=a("."+l+"-bg"),h.$closeButton=a("").addClass(l+"-close"),h.$wrapper=a("
").addClass(l+"-wrapper"),h.$modal=c,h.$modal.addClass(l),h.$modal.css("visibility","visible"),h.$modal.append(h.$closeButton),h.$wrapper.append(h.$modal),h.$body.append(h.$wrapper),h.$confirmButton=h.$modal.find("."+l+"-confirm"),h.$cancelButton=h.$modal.find("."+l+"-cancel"),e=b(h.$overlay),f=b(h.$modal),g=b(h.$bg),h.td=f>e?f:e,h.td=g>h.td?g:h.td,h.$wrapper.on("click."+l,h.$closeButton.selector,function(a){a.preventDefault(),h.close()}),h.$wrapper.on("click."+l,h.$cancelButton.selector,function(a){a.preventDefault(),h.$modal.trigger("cancel"),h.settings.closeOnCancel&&h.close("cancellation")}),h.$wrapper.on("click."+l,h.$confirmButton.selector,function(a){a.preventDefault(),h.$modal.trigger("confirm"),h.settings.closeOnConfirm&&h.close("confirmation")}),a(document).bind("keyup."+l,function(a){27===a.keyCode&&h.settings.closeOnEscape&&h.close()}),h.$wrapper.on("click."+l,function(b){var c=a(b.target);c.hasClass(l+"-wrapper")&&h.settings.closeOnAnyClick&&h.close()}),h.index=a[k].lookup.push(h)-1,h.busy=!1}function h(b,c){var d,e,f=location.hash.replace("#","");if("undefined"==typeof c&&(c=!0),f){try{e=a("[data-"+k+"-id="+f.replace(new RegExp("/","g"),"\\/")+"]")}catch(g){}e&&e.length&&(d=a[k].lookup[e.data(k)],d&&d.settings.hashTracking&&d.open())}else c&&i&&!i.busy&&i.settings.hashTracking&&i.close()}var i,j,k="remodal",l=window.remodalGlobals&&window.remodalGlobals.namespace||k,m=a.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnAnyClick:!0},window.remodalGlobals&&window.remodalGlobals.defaults);g.prototype.open=function(){if(!this.busy){var b,c=this;c.busy=!0,c.$modal.trigger("open"),b=c.$modal.attr("data-"+k+"-id"),b&&c.settings.hashTracking&&(j=a(window).scrollTop(),location.hash=b),i&&i!==c&&(i.$overlay.hide(),i.$wrapper.hide(),i.$body.removeClass(l+"-is-active")),i=c,d(),c.$overlay.show(),c.$wrapper.show(),setTimeout(function(){c.$body.addClass(l+"-is-active"),setTimeout(function(){c.busy=!1,c.$modal.trigger("opened")},c.td+50)},25)}},g.prototype.close=function(b){if(!this.busy){this.busy=!0,this.$modal.trigger({type:"close",reason:b});var c=this;c.settings.hashTracking&&c.$modal.attr("data-"+k+"-id")===location.hash.substr(1)&&(location.hash="",a(window).scrollTop(j)),c.$body.removeClass(l+"-is-active"),setTimeout(function(){c.$overlay.hide(),c.$wrapper.hide(),e(),c.busy=!1,c.$modal.trigger({type:"closed",reason:b})},c.td+50)}},a[k]={lookup:[]},a.fn[k]=function(b){var c,d;return this.each(function(e,f){d=a(f),null==d.data(k)?(c=new g(d,b),d.data(k,c.index),c.settings.hashTracking&&d.attr("data-"+k+"-id")===location.hash.substr(1)&&c.open()):c=a[k].lookup[d.data(k)]}),c},a(document).ready(function(){a(document).on("click","[data-"+k+"-target]",function(b){b.preventDefault();var c=b.currentTarget,d=c.getAttribute("data-"+k+"-target"),e=a("[data-"+k+"-id="+d+"]");a[k].lookup[e.data(k)].open()}),a(document).find("."+l).each(function(b,c){var d=a(c),e=d.data(k+"-options");e?("string"==typeof e||e instanceof String)&&(e=f(e)):e={},d[k](e)})}),a(window).bind("hashchange."+l,h)}(window.jQuery||window.Zepto); \ No newline at end of file +!function(a){"use strict";function b(a){var b,c,d,e,f=a.css("transition-duration")||a.css("-webkit-transition-duration")||a.css("-moz-transition-duration")||a.css("-o-transition-duration")||a.css("-ms-transition-duration")||"0s",g=a.css("transition-delay")||a.css("-webkit-transition-delay")||a.css("-moz-transition-delay")||a.css("-o-transition-delay")||a.css("-ms-transition-delay")||"0s";for(f=f.split(", "),g=g.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;c>e;e++)d=parseFloat(f[e])+parseFloat(g[e]),d>b&&(b=d);return 1e3*d}function c(){if(a(document.body).height()<=a(window).height())return 0;var b,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),b=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),b-c}function d(){var b,d,e=a("html"),f=l+"-is-locked";e.hasClass(f)||(b=a(document.body),d=parseInt(b.css("padding-right"),10)+c(),b.css("padding-right",d+"px"),e.addClass(f))}function e(){var b,d,e=a("html"),f=l+"-is-locked";e.hasClass(f)&&(b=a(document.body),d=parseInt(b.css("padding-right"),10)-c(),b.css("padding-right",d+"px"),e.removeClass(f))}function f(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;c>e;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||("false"===d?!1:d)),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function g(c,d){var e,f,g,h=this;h.settings=a.extend({},m,d),h.$body=a(document.body),h.$overlay=a("."+l+"-overlay"),h.$overlay.length||(h.$overlay=a("
").addClass(l+"-overlay"),h.$body.append(h.$overlay)),h.$bg=a("."+l+"-bg"),h.$closeButton=a("").addClass(l+"-close"),h.$wrapper=a("
").addClass(l+"-wrapper"),h.$modal=c,h.$modal.addClass(l),h.$modal.css("visibility","visible"),h.$modal.append(h.$closeButton),h.$wrapper.append(h.$modal),h.$body.append(h.$wrapper),h.$confirmButton=h.$modal.find("."+l+"-confirm"),h.$cancelButton=h.$modal.find("."+l+"-cancel"),e=b(h.$overlay),f=b(h.$modal),g=b(h.$bg),h.td=f>e?f:e,h.td=g>h.td?g:h.td,h.$wrapper.on("click."+l,"."+l+"-close",function(a){a.preventDefault(),h.close()}),h.$wrapper.on("click."+l,"."+l+"-cancel",function(a){a.preventDefault(),h.$modal.trigger("cancel"),h.settings.closeOnCancel&&h.close("cancellation")}),h.$wrapper.on("click."+l,"."+l+"-confirm",function(a){a.preventDefault(),h.$modal.trigger("confirm"),h.settings.closeOnConfirm&&h.close("confirmation")}),a(document).on("keyup."+l,function(a){27===a.keyCode&&h.settings.closeOnEscape&&h.close()}),h.$wrapper.on("click."+l,function(b){var c=a(b.target);c.hasClass(l+"-wrapper")&&h.settings.closeOnAnyClick&&h.close()}),h.index=a[k].lookup.push(h)-1,h.busy=!1}function h(b,c){var d,e,f=location.hash.replace("#","");if("undefined"==typeof c&&(c=!0),f){try{e=a("[data-"+k+"-id="+f.replace(new RegExp("/","g"),"\\/")+"]")}catch(g){}e&&e.length&&(d=a[k].lookup[e.data(k)],d&&d.settings.hashTracking&&d.open())}else c&&i&&!i.busy&&i.settings.hashTracking&&i.close()}var i,j,k="remodal",l=window.remodalGlobals&&window.remodalGlobals.namespace||k,m=a.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnAnyClick:!0},window.remodalGlobals&&window.remodalGlobals.defaults);g.prototype.open=function(){if(!this.busy){var b,c=this;c.busy=!0,c.$modal.trigger("open"),b=c.$modal.attr("data-"+k+"-id"),b&&c.settings.hashTracking&&(j=a(window).scrollTop(),location.hash=b),i&&i!==c&&(i.$overlay.hide(),i.$wrapper.hide(),i.$body.removeClass(l+"-is-active")),i=c,d(),c.$overlay.show(),c.$wrapper.show(),setTimeout(function(){c.$body.addClass(l+"-is-active"),setTimeout(function(){c.busy=!1,c.$modal.trigger("opened")},c.td+50)},25)}},g.prototype.close=function(b){if(!this.busy){this.busy=!0,this.$modal.trigger({type:"close",reason:b});var c=this;c.settings.hashTracking&&c.$modal.attr("data-"+k+"-id")===location.hash.substr(1)&&(location.hash="",a(window).scrollTop(j)),c.$body.removeClass(l+"-is-active"),setTimeout(function(){c.$overlay.hide(),c.$wrapper.hide(),e(),c.busy=!1,c.$modal.trigger({type:"closed",reason:b})},c.td+50)}},a[k]={lookup:[]},a.fn[k]=function(b){var c,d;return this.each(function(e,f){d=a(f),null==d.data(k)?(c=new g(d,b),d.data(k,c.index),c.settings.hashTracking&&d.attr("data-"+k+"-id")===location.hash.substr(1)&&c.open()):c=a[k].lookup[d.data(k)]}),c},a(document).ready(function(){a(document).on("click","[data-"+k+"-target]",function(b){b.preventDefault();var c=b.currentTarget,d=c.getAttribute("data-"+k+"-target"),e=a("[data-"+k+"-id="+d+"]");a[k].lookup[e.data(k)].open()}),a(document).find("."+l).each(function(b,c){var d=a(c),e=d.data(k+"-options");e?("string"==typeof e||e instanceof String)&&(e=f(e)):e={},d[k](e)})}),a(window).bind("hashchange."+l,h)}(window.jQuery||window.Zepto); \ No newline at end of file diff --git a/remodal.jquery.json b/remodal.jquery.json index 0ffd48d..e9da501 100644 --- a/remodal.jquery.json +++ b/remodal.jquery.json @@ -14,7 +14,7 @@ "ui", "zepto" ], - "version": "0.6.0", + "version": "0.6.1", "author": { "name": "Ilya Makarov", "email": "dfrost.00@gmail.com",