From e168134c9f15618556755563e3d3dd8acd371df3 Mon Sep 17 00:00:00 2001 From: VodkaBears Date: Mon, 31 Mar 2014 23:14:51 +0400 Subject: [PATCH] Update version --- bower.json | 2 +- dist/jquery.remodal.css | 150 +++++++++++++++++++------------------ dist/jquery.remodal.js | 11 ++- dist/jquery.remodal.min.js | 4 +- remodal.jquery.json | 2 +- src/jquery.remodal.css | 2 +- src/jquery.remodal.js | 2 +- 7 files changed, 88 insertions(+), 85 deletions(-) diff --git a/bower.json b/bower.json index f7fe351..c380b0c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "remodal", - "version": "0.1.2", + "version": "0.1.3", "homepage": "http://vodkabears.github.io/remodal/", "authors": [ "Ilya Makarov " diff --git a/dist/jquery.remodal.css b/dist/jquery.remodal.css index ecb0682..40ce507 100644 --- a/dist/jquery.remodal.css +++ b/dist/jquery.remodal.css @@ -1,48 +1,26 @@ -/*! Remodal - v0.1.2 - 2014-03-05 +/*! Remodal - v0.1.3 - 2014-03-31 * https://github.com/VodkaBears/remodal * Copyright (c) 2014 VodkaBears; */ -/* Fonts */ -@import url(http://fonts.googleapis.com/css?family=Exo+2:700,400&subset=latin,cyrillic); +/* ========================================================================== + Remodal necessary styles + ========================================================================== */ + +/* Hide scroll bar */ -/* Lock screen(begin) */ html.remodal_lock, body.remodal_lock { overflow: hidden; } -/* Lock screen(end) */ - -/* Background for effects(begin) */ -.remodal-bg { - -webkit-transition: -webkit-filter 0.2s linear; - -moz-transition: -moz-filter 0.2s linear; - -o-transition: -o-filter 0.2s linear; - transition: filter 0.2s linear; -} +/* Anti FOUC */ -body.remodal_active .remodal-bg { - -webkit-filter: blur(3px); - -moz-filter: blur(3px); - -o-filter: blur(3px); - -ms-filter: blur(3px); - filter: blur(3px); -} - -/* Background for effects(end) */ - -/* Anti FOUC(begin) */ .remodal, [data-remodal-id] { visibility: hidden; } -/* Anti FOUC(end)*/ +/* Overlay necessary styles */ -/* Remodal overlay(begin) */ .remodal-overlay { - display: none; - overflow: auto; - -webkit-overflow-scrolling: touch; - position: fixed; top: 0; left: 0; @@ -50,51 +28,82 @@ body.remodal_active .remodal-bg { bottom: 0; z-index: 10000; - text-align: center; - - opacity: 0; - background: rgba(33, 36, 46, 0.95); - /* IE6–IE8 */ - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EE21242E, endColorstr=#EE21242E); - zoom: 1; - -webkit-transition: opacity 0.2s linear; - -moz-transition: opacity 0.2s linear; - -o-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; -} + display: none; + overflow: auto; + -webkit-overflow-scrolling: touch; -.remodal-overlay > * { - -webkit-transform: translateZ(0px); + text-align: center; } .remodal-overlay:after { display: inline-block; - height: 100%; margin-left: -0.05em; content: ''; - vertical-align: middle; } -body.remodal_active .remodal-overlay { - opacity: 1; +/* Fix iPad, iPhone glitches */ + +.remodal-overlay > * { + -webkit-transform: translateZ(0px); } -/* Remodal overlay(end) */ +/* Modal dialog necessary styles */ + +.remodal { + position: relative; + + display: inline-block; +} + +/* ========================================================================== + Remodal default theme + ========================================================================== */ + +/* Default theme font */ + +@import url(http://fonts.googleapis.com/css?family=Exo+2:700,400&subset=latin,cyrillic); -/* Remodal window(begin) */ .remodal, .remodal * { font-family: 'Exo 2', sans-serif; } -.remodal { - font-size: 16px; +/* Background for effects */ - position: relative; +.remodal-bg { + -webkit-transition: -webkit-filter 0.2s linear; + -moz-transition: -moz-filter 0.2s linear; + -o-transition: -o-filter 0.2s linear; + transition: filter 0.2s linear; +} - display: inline-block; +body.remodal_active .remodal-bg { + -webkit-filter: blur(3px); + -moz-filter: blur(3px); + -o-filter: blur(3px); + -ms-filter: blur(3px); + filter: blur(3px); +} + +/* Overlay default theme styles */ + +.remodal-overlay { + opacity: 0; + background: rgba(33, 36, 46, 0.95); + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; +} +body.remodal_active .remodal-overlay { + opacity: 1; +} + +/* Modal dialog default theme styles */ + +.remodal { width: 100%; min-height: 100%; padding: 35px; @@ -102,14 +111,12 @@ body.remodal_active .remodal-overlay { -moz-box-sizing: border-box; box-sizing: border-box; - vertical-align: middle; - + font-size: 16px; background: #f4f4f4; background-clip: padding-box; color: #182a3c; -webkit-box-shadow: 0px 0px 8px #171a24; box-shadow: 0px 0px 8px #171a24; - -webkit-transform: scale(0.95); -moz-transform: scale(0.95); -ms-transform: scale(0.95); @@ -129,9 +136,14 @@ body.remodal_active .remodal { transform: scale(1); } -/* Remodal window(end) */ +/* Modal dialog vertical align */ + +.remodal, .remodal-overlay:after { + vertical-align: middle; +} + +/* Close button */ -/* Remodal window close button(begin) */ .remodal-close { position: absolute; top: 5px; @@ -141,7 +153,6 @@ body.remodal_active .remodal { height: 28px; text-decoration: none; - -webkit-border-radius: 50%; border-radius: 50%; border: 2px solid #3e5368; @@ -153,16 +164,14 @@ body.remodal_active .remodal { .remodal-close:after { display: block; + font-size: 28px; font-family: Arial, 'Helvetica CY', 'Nimbus Sans L', sans-serif !important; - content: "×"; line-height: 28px; cursor: pointer; text-decoration: none; - color: #3e5368; - -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; @@ -177,25 +186,21 @@ body.remodal_active .remodal { color: #f4f4f4; } -/* Remodal window close button(end) */ +/* Dialog buttons */ -/* Remodal buttons(begin) */ .remodal-confirm, .remodal-cancel { - font-size: 10pt; - display: inline-block; - width: 120px; padding: 9px 0; margin: 0 0 5px 0; - background-clip: padding-box; + font-size: 10pt; cursor: pointer; text-decoration: none; text-align: center; - -webkit-border-radius: 50px; border-radius: 50px; + background-clip: padding-box; -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; @@ -224,9 +229,8 @@ body.remodal_active .remodal { color: #f4f4f4; } -/* Remodal buttons(end) */ - -/************** Media queries **************/ +/* Media queries + ========================================================================== */ @media only screen and (min-width: 40.063em) /* min-width 641px */ { .remodal { diff --git a/dist/jquery.remodal.js b/dist/jquery.remodal.js index ff03121..f3e70e4 100644 --- a/dist/jquery.remodal.js +++ b/dist/jquery.remodal.js @@ -1,4 +1,4 @@ -/*! Remodal - v0.1.2 - 2014-03-05 +/*! Remodal - v0.1.3 - 2014-03-31 * https://github.com/VodkaBears/remodal * Copyright (c) 2014 VodkaBears; */ ;(function ($) { @@ -20,10 +20,8 @@ lookup: [] }; - /** - * Current modal - */ - var current; + var current, // current modal + scrollTop; // scroll position /** * Get transition duration in ms @@ -179,6 +177,7 @@ var id = this.modal.attr("data-" + pluginName + "-id"); if (id && this.settings.hashTracking) { + scrollTop = $(window).scrollTop(); location.hash = id; } @@ -214,8 +213,8 @@ if (this.settings.hashTracking && this.modal.attr("data-" + pluginName + "-id") === location.hash.substr(1)) { - // save current scroll position location.hash = ""; + $(window).scrollTop(scrollTop); } this.body.removeClass(pluginName + "_active"); diff --git a/dist/jquery.remodal.min.js b/dist/jquery.remodal.min.js index 83f99b5..62e2205 100644 --- a/dist/jquery.remodal.min.js +++ b/dist/jquery.remodal.min.js @@ -1,4 +1,4 @@ -/*! Remodal - v0.1.2 - 2014-03-05 +/*! Remodal - v0.1.3 - 2014-03-31 * https://github.com/VodkaBears/remodal * Copyright (c) 2014 VodkaBears; */ -!function(a){"use strict";function b(b,e){this.settings=a.extend({},d,e),this.modal=b,this.buildDOM(),this.addEventListeners(),this.index=a[c].lookup.push(this)-1,this.busy=!1}var c="remodal",d={hashTracking:!0};a[c]={lookup:[]};var e,f=function(a){var b=a.css("transition-duration")||a.css("-webkit-transition-duration")||a.css("-moz-transition-duration")||a.css("-o-transition-duration")||a.css("-ms-transition-duration")||0,c=a.css("transition-delay")||a.css("-webkit-transition-delay")||a.css("-moz-transition-delay")||a.css("-o-transition-delay")||a.css("-ms-transition-delay")||0;return 1e3*(parseFloat(b)+parseFloat(c))},g=function(){var a=document.createElement("div");a.style.visibility="hidden",a.style.width="100px",document.body.appendChild(a);var b=a.offsetWidth;a.style.overflow="scroll";var c=document.createElement("div");c.style.width="100%",a.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),b-d},h=function(){a("html, body").addClass(c+"_lock"),a(document.body).css("padding-right","+="+g())},i=function(){a("html, body").removeClass(c+"_lock"),a(document.body).css("padding-right","-="+g())};b.prototype.buildDOM=function(){this.body=a(document.body),this.bg=a("."+c+"-bg"),this.modalClose=a("").addClass(c+"-close"),this.overlay=a("
").addClass(c+"-overlay"),this.modal.hasClass(c)||this.modal.addClass(c),this.modal.css("visibility","visible"),this.modal.append(this.modalClose),this.overlay.append(this.modal),this.body.append(this.overlay),this.confirm=this.modal.find("."+c+"-confirm"),this.cancel=this.modal.find("."+c+"-cancel");var b=f(this.overlay),d=f(this.modal),e=f(this.bg);this.td=d>b?d:b,this.td=e>this.td?e:this.td},b.prototype.addEventListeners=function(){this.modalClose.bind("click."+c,function(a){a.preventDefault(),this.close()}.bind(this)),this.cancel.bind("click."+c,function(a){a.preventDefault(),this.modal.trigger("cancel"),this.close()}.bind(this)),this.confirm.bind("click."+c,function(a){a.preventDefault(),this.modal.trigger("confirm"),this.close()}.bind(this)),a(document).bind("keyup."+c,function(a){27===a.keyCode&&this.close()}.bind(this)),this.overlay.bind("click."+c,function(b){var d=a(b.target);d.hasClass(c+"-overlay")&&this.close()}.bind(this))},b.prototype.open=function(){if(!this.busy){this.busy=!0,this.modal.trigger("open");var a=this.modal.attr("data-"+c+"-id");a&&this.settings.hashTracking&&(location.hash=a),e&&e!==this&&(e.overlay.hide(),e.body.removeClass(c+"_active")),e=this,h(),this.overlay.show(),setTimeout(function(){this.body.addClass(c+"_active"),setTimeout(function(){this.busy=!1,this.modal.trigger("opened")}.bind(this),this.td+50)}.bind(this),25)}},b.prototype.close=function(){this.busy||(this.busy=!0,this.modal.trigger("close"),this.settings.hashTracking&&this.modal.attr("data-"+c+"-id")===location.hash.substr(1)&&(location.hash=""),this.body.removeClass(c+"_active"),setTimeout(function(){this.overlay.hide(),i(),this.busy=!1,this.modal.trigger("closed")}.bind(this),this.td+50))},a&&(a.fn[c]=function(d){var e;return this.each(function(f,g){var h=a(g);h.data(c)||(e=new b(h,d),h.data(c,e.index),e.settings.hashTracking&&h.attr("data-"+c+"-id")===location.hash.substr(1)&&e.open())}),e}),a(document).on("click","[data-"+c+"-target]",function(b){b.preventDefault();var d=b.currentTarget,e=d.getAttribute("data-"+c+"-target"),f=a("[data-"+c+"-id="+e+"]");a[c].lookup[f.data(c)].open()}),a(document).find("."+c).each(function(b,d){var e=a(d),f=e.data(c+"-options");f||(f={}),e[c](f)});var j=function(b,d){var f=location.hash.replace("#","");if("undefined"==typeof d&&(d=!0),f){var g=a("[data-"+c+"-id="+f+"]");if(g.length){var h=a[c].lookup[g.data(c)];h&&h.settings.hashTracking&&h.open()}}else d&&e&&!e.busy&&e.settings.hashTracking&&e.close()};a(window).bind("hashchange."+c,j)}(window.jQuery||window.Zepto); \ No newline at end of file +!function(a){"use strict";function b(b,e){this.settings=a.extend({},d,e),this.modal=b,this.buildDOM(),this.addEventListeners(),this.index=a[c].lookup.push(this)-1,this.busy=!1}var c="remodal",d={hashTracking:!0};a[c]={lookup:[]};var e,f,g=function(a){var b=a.css("transition-duration")||a.css("-webkit-transition-duration")||a.css("-moz-transition-duration")||a.css("-o-transition-duration")||a.css("-ms-transition-duration")||0,c=a.css("transition-delay")||a.css("-webkit-transition-delay")||a.css("-moz-transition-delay")||a.css("-o-transition-delay")||a.css("-ms-transition-delay")||0;return 1e3*(parseFloat(b)+parseFloat(c))},h=function(){var a=document.createElement("div");a.style.visibility="hidden",a.style.width="100px",document.body.appendChild(a);var b=a.offsetWidth;a.style.overflow="scroll";var c=document.createElement("div");c.style.width="100%",a.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),b-d},i=function(){a("html, body").addClass(c+"_lock"),a(document.body).css("padding-right","+="+h())},j=function(){a("html, body").removeClass(c+"_lock"),a(document.body).css("padding-right","-="+h())};b.prototype.buildDOM=function(){this.body=a(document.body),this.bg=a("."+c+"-bg"),this.modalClose=a("").addClass(c+"-close"),this.overlay=a("
").addClass(c+"-overlay"),this.modal.hasClass(c)||this.modal.addClass(c),this.modal.css("visibility","visible"),this.modal.append(this.modalClose),this.overlay.append(this.modal),this.body.append(this.overlay),this.confirm=this.modal.find("."+c+"-confirm"),this.cancel=this.modal.find("."+c+"-cancel");var b=g(this.overlay),d=g(this.modal),e=g(this.bg);this.td=d>b?d:b,this.td=e>this.td?e:this.td},b.prototype.addEventListeners=function(){this.modalClose.bind("click."+c,function(a){a.preventDefault(),this.close()}.bind(this)),this.cancel.bind("click."+c,function(a){a.preventDefault(),this.modal.trigger("cancel"),this.close()}.bind(this)),this.confirm.bind("click."+c,function(a){a.preventDefault(),this.modal.trigger("confirm"),this.close()}.bind(this)),a(document).bind("keyup."+c,function(a){27===a.keyCode&&this.close()}.bind(this)),this.overlay.bind("click."+c,function(b){var d=a(b.target);d.hasClass(c+"-overlay")&&this.close()}.bind(this))},b.prototype.open=function(){if(!this.busy){this.busy=!0,this.modal.trigger("open");var b=this.modal.attr("data-"+c+"-id");b&&this.settings.hashTracking&&(f=a(window).scrollTop(),location.hash=b),e&&e!==this&&(e.overlay.hide(),e.body.removeClass(c+"_active")),e=this,i(),this.overlay.show(),setTimeout(function(){this.body.addClass(c+"_active"),setTimeout(function(){this.busy=!1,this.modal.trigger("opened")}.bind(this),this.td+50)}.bind(this),25)}},b.prototype.close=function(){this.busy||(this.busy=!0,this.modal.trigger("close"),this.settings.hashTracking&&this.modal.attr("data-"+c+"-id")===location.hash.substr(1)&&(location.hash="",a(window).scrollTop(f)),this.body.removeClass(c+"_active"),setTimeout(function(){this.overlay.hide(),j(),this.busy=!1,this.modal.trigger("closed")}.bind(this),this.td+50))},a&&(a.fn[c]=function(d){var e;return this.each(function(f,g){var h=a(g);h.data(c)||(e=new b(h,d),h.data(c,e.index),e.settings.hashTracking&&h.attr("data-"+c+"-id")===location.hash.substr(1)&&e.open())}),e}),a(document).on("click","[data-"+c+"-target]",function(b){b.preventDefault();var d=b.currentTarget,e=d.getAttribute("data-"+c+"-target"),f=a("[data-"+c+"-id="+e+"]");a[c].lookup[f.data(c)].open()}),a(document).find("."+c).each(function(b,d){var e=a(d),f=e.data(c+"-options");f||(f={}),e[c](f)});var k=function(b,d){var f=location.hash.replace("#","");if("undefined"==typeof d&&(d=!0),f){var g=a("[data-"+c+"-id="+f+"]");if(g.length){var h=a[c].lookup[g.data(c)];h&&h.settings.hashTracking&&h.open()}}else d&&e&&!e.busy&&e.settings.hashTracking&&e.close()};a(window).bind("hashchange."+c,k)}(window.jQuery||window.Zepto); \ No newline at end of file diff --git a/remodal.jquery.json b/remodal.jquery.json index a5a19bc..b15c2db 100644 --- a/remodal.jquery.json +++ b/remodal.jquery.json @@ -14,7 +14,7 @@ "ui", "zepto" ], - "version": "0.1.2", + "version": "0.1.3", "author": { "name": "Ilya Makarov", "email": "dfrost.00@gmail.com", diff --git a/src/jquery.remodal.css b/src/jquery.remodal.css index 4908b58..40ce507 100644 --- a/src/jquery.remodal.css +++ b/src/jquery.remodal.css @@ -1,4 +1,4 @@ -/*! Remodal - v0.1.2 - 2014-03-05 +/*! Remodal - v0.1.3 - 2014-03-31 * https://github.com/VodkaBears/remodal * Copyright (c) 2014 VodkaBears; */ diff --git a/src/jquery.remodal.js b/src/jquery.remodal.js index 0789d5d..f3e70e4 100644 --- a/src/jquery.remodal.js +++ b/src/jquery.remodal.js @@ -1,4 +1,4 @@ -/*! Remodal - v0.1.2 - 2014-03-05 +/*! Remodal - v0.1.3 - 2014-03-31 * https://github.com/VodkaBears/remodal * Copyright (c) 2014 VodkaBears; */ ;(function ($) {