From 8836c134a9da67205e9e4fc4f0a3dcf5ed2bc876 Mon Sep 17 00:00:00 2001 From: amador Date: Tue, 27 Mar 2018 15:39:33 +0200 Subject: [PATCH 1/3] Added new events when animation begins and ends (Address issue #112) - The following events were added: 1. flip:start 2. unflip:start 3. unflip:done A demo can be found here: https://jsfiddle.net/acepero13/tvk43dms/11/ --- dist/jquery.flip.js | 43 ++++++++++++++++++++++--------------- dist/jquery.flip.min.js | 6 +++--- dist/jquery.flip.min.js.map | 2 +- src/flip.js | 39 ++++++++++++++++++++------------- 4 files changed, 54 insertions(+), 36 deletions(-) diff --git a/dist/jquery.flip.js b/dist/jquery.flip.js index bc5d328..7974c7b 100644 --- a/dist/jquery.flip.js +++ b/dist/jquery.flip.js @@ -1,6 +1,6 @@ -/*! flip - v1.1.2 - 2016-10-20 +/*! flip - v1.1.2 - 2018-03-27 * https://github.com/nnattawat/flip -* Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */ +* Copyright (c) 2018 Nattawat Nonsung; Licensed MIT */ (function( $ ) { /* * Private attributes and method @@ -93,24 +93,14 @@ */ $.extend(Flip.prototype, { - flipDone: function(callback) { - var self = this; - // Providing a nicely wrapped up callback because transform is essentially async - self.element.one(whichTransitionEvent(), function() { - self.element.trigger('flip:done'); - if (typeof callback === 'function') { - callback.call(self.element); - } - }); - }, - flip: function(callback) { if (this.isFlipped) { return; } + this.fireEvents(['flip:start']); this.isFlipped = true; - + var rotateAxis = "rotate" + this.setting.axis; this.frontElement.css({ transform: rotateAxis + (this.setting.reverse ? "(-180deg)" : "(180deg)"), @@ -121,7 +111,7 @@ transform: rotateAxis + "(0deg)", "z-index": "1" }); - this.flipDone(callback); + this.onTransitionFinished(callback, ['flip:done']); }, unflip: function(callback) { @@ -129,6 +119,7 @@ return; } + this.fireEvents(['unflip:start']); this.isFlipped = false; var rotateAxis = "rotate" + this.setting.axis; @@ -141,7 +132,25 @@ transform: rotateAxis + (this.setting.reverse ? "(180deg)" : "(-180deg)"), "z-index": "0" }); - this.flipDone(callback); + this.onTransitionFinished(callback, ['flip:done', 'unflip:done']); + }, + + onTransitionFinished: function(callback, eventsToTrigger){ + var self = this; + // Providing a nicely wrapped up callback because transform is essentially async + self.element.one(whichTransitionEvent(), function() { + self.fireEvents(eventsToTrigger); + if (typeof callback === 'function') { + callback.call(self.element); + } + }); + }, + + fireEvents: function(events){ + var self = this; + $.each(events, function(index, event) { + self.element.trigger(event); + }); }, getFrontElement: function() { @@ -272,7 +281,7 @@ }, flipChanged: function(callback) { - this.element.trigger('flip:change'); + this.fireEvents(['flip:change']); if (typeof callback === 'function') { callback.call(this.element); } diff --git a/dist/jquery.flip.min.js b/dist/jquery.flip.min.js index 53cfe2b..e78bf53 100644 --- a/dist/jquery.flip.min.js +++ b/dist/jquery.flip.min.js @@ -1,6 +1,6 @@ -/*! flip - v1.1.2 - 2016-10-20 +/*! flip - v1.1.2 - 2018-03-27 * https://github.com/nnattawat/flip -* Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */ +* Copyright (c) 2018 Nattawat Nonsung; Licensed MIT */ -!function(a){var b=function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(void 0!==b.style[a])return c[a]},c=function(b,c,d){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=a.extend(this.setting,c),"string"!=typeof c.axis||"x"!==c.axis.toLowerCase()&&"y"!==c.axis.toLowerCase()||(this.setting.axis=c.axis.toLowerCase()),"boolean"==typeof c.reverse&&(this.setting.reverse=c.reverse),"string"==typeof c.trigger&&(this.setting.trigger=c.trigger.toLowerCase());var e=parseInt(c.speed);isNaN(e)||(this.setting.speed=e),"boolean"==typeof c.forceHeight&&(this.setting.forceHeight=c.forceHeight),"boolean"==typeof c.forceWidth&&(this.setting.forceWidth=c.forceWidth),"boolean"==typeof c.autoSize&&(this.setting.autoSize=c.autoSize),("string"==typeof c.front||c.front instanceof a)&&(this.setting.front=c.front),("string"==typeof c.back||c.back instanceof a)&&(this.setting.back=c.back),this.element=b,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(d)};a.extend(c.prototype,{flipDone:function(a){var c=this;c.element.one(b(),function(){c.element.trigger("flip:done"),"function"==typeof a&&a.call(c.element)})},flip:function(a){if(!this.isFlipped){this.isFlipped=!0;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:b+"(0deg)","z-index":"1"}),this.flipDone(a)}},unflip:function(a){if(this.isFlipped){this.isFlipped=!1;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+"(0deg)","z-index":"1"}),this.backElement.css({transform:b+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.flipDone(a)}},getFrontElement:function(){return this.setting.front instanceof a?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof a?this.setting.back:this.element.find(this.setting.back)},init:function(a){var b=this,c=b.frontElement.add(b.backElement),d="rotate"+b.setting.axis,e=2*b.element["outer"+("rotatex"===d?"Height":"Width")](),f={perspective:e,position:"relative"},g={transform:d+"("+(b.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},h={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};b.setting.forceHeight?c.outerHeight(b.element.height()):b.setting.autoSize&&(h.height="100%"),b.setting.forceWidth?c.outerWidth(b.element.width()):b.setting.autoSize&&(h.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(f["-webkit-transform-style"]="preserve-3d"),c.css(h).find("*").css({"backface-visibility":"hidden"}),b.element.css(f),b.backElement.css(g),setTimeout(function(){var d=b.setting.speed/1e3||.5;c.css({transition:"all "+d+"s ease-out"}),"function"==typeof a&&a.call(b.element)},20),b.attachEvents()},clickHandler:function(b){b||(b=window.event),this.element.find(a(b.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var b=this;b.element.off("mouseleave.flip"),b.flip(),setTimeout(function(){b.element.on("mouseleave.flip",a.proxy(b.unflip,b)),b.element.is(":hover")||b.unflip()},b.setting.speed+150)},attachEvents:function(){var b=this;"click"===b.setting.trigger?b.element.on(a.fn.tap?"tap.flip":"click.flip",a.proxy(b.clickHandler,b)):"hover"===b.setting.trigger&&(b.element.on("mouseenter.flip",a.proxy(b.hoverHandler,b)),b.element.on("mouseleave.flip",a.proxy(b.unflip,b)))},flipChanged:function(a){this.element.trigger("flip:change"),"function"==typeof a&&a.call(this.element)},changeSettings:function(a,b){var c=this,d=!1;if(void 0!==a.axis&&c.setting.axis!==a.axis.toLowerCase()&&(c.setting.axis=a.axis.toLowerCase(),d=!0),void 0!==a.reverse&&c.setting.reverse!==a.reverse&&(c.setting.reverse=a.reverse,d=!0),d){var e=c.frontElement.add(c.backElement),f=e.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);e.css({transition:"none"});var g="rotate"+c.setting.axis;c.isFlipped?c.frontElement.css({transform:g+(c.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):c.backElement.css({transform:g+(c.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout(function(){e.css(f),c.flipChanged(b)},0)}else c.flipChanged(b)}}),a.fn.flip=function(b,d){return"function"==typeof b&&(d=b),"string"==typeof b||"boolean"==typeof b?this.each(function(){var c=a(this).data("flip-model");"toggle"===b&&(b=!c.isFlipped),b?c.flip(d):c.unflip(d)}):this.each(function(){if(a(this).data("flip-model")){var e=a(this).data("flip-model");!b||void 0===b.axis&&void 0===b.reverse||e.changeSettings(b,d)}else a(this).data("flip-model",new c(a(this),b||{},d))}),this}}(jQuery); +!function(a){var b=function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(void 0!==b.style[a])return c[a]},c=function(b,c,d){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=a.extend(this.setting,c),"string"!=typeof c.axis||"x"!==c.axis.toLowerCase()&&"y"!==c.axis.toLowerCase()||(this.setting.axis=c.axis.toLowerCase()),"boolean"==typeof c.reverse&&(this.setting.reverse=c.reverse),"string"==typeof c.trigger&&(this.setting.trigger=c.trigger.toLowerCase());var e=parseInt(c.speed);isNaN(e)||(this.setting.speed=e),"boolean"==typeof c.forceHeight&&(this.setting.forceHeight=c.forceHeight),"boolean"==typeof c.forceWidth&&(this.setting.forceWidth=c.forceWidth),"boolean"==typeof c.autoSize&&(this.setting.autoSize=c.autoSize),("string"==typeof c.front||c.front instanceof a)&&(this.setting.front=c.front),("string"==typeof c.back||c.back instanceof a)&&(this.setting.back=c.back),this.element=b,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(d)};a.extend(c.prototype,{flip:function(a){if(!this.isFlipped){this.fireEvents(["flip:start"]),this.isFlipped=!0;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:b+"(0deg)","z-index":"1"}),this.onTransitionFinished(a,["flip:done"])}},unflip:function(a){if(this.isFlipped){this.fireEvents(["unflip:start"]),this.isFlipped=!1;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+"(0deg)","z-index":"1"}),this.backElement.css({transform:b+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.onTransitionFinished(a,["flip:done","unflip:done"])}},onTransitionFinished:function(a,c){var d=this;d.element.one(b(),function(){d.fireEvents(c),"function"==typeof a&&a.call(d.element)})},fireEvents:function(b){var c=this;a.each(b,function(a,b){c.element.trigger(b)})},getFrontElement:function(){return this.setting.front instanceof a?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof a?this.setting.back:this.element.find(this.setting.back)},init:function(a){var b=this,c=b.frontElement.add(b.backElement),d="rotate"+b.setting.axis,e=2*b.element["outer"+("rotatex"===d?"Height":"Width")](),f={perspective:e,position:"relative"},g={transform:d+"("+(b.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},h={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};b.setting.forceHeight?c.outerHeight(b.element.height()):b.setting.autoSize&&(h.height="100%"),b.setting.forceWidth?c.outerWidth(b.element.width()):b.setting.autoSize&&(h.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(f["-webkit-transform-style"]="preserve-3d"),c.css(h).find("*").css({"backface-visibility":"hidden"}),b.element.css(f),b.backElement.css(g),setTimeout(function(){var d=b.setting.speed/1e3||.5;c.css({transition:"all "+d+"s ease-out"}),"function"==typeof a&&a.call(b.element)},20),b.attachEvents()},clickHandler:function(b){b||(b=window.event),this.element.find(a(b.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var b=this;b.element.off("mouseleave.flip"),b.flip(),setTimeout(function(){b.element.on("mouseleave.flip",a.proxy(b.unflip,b)),b.element.is(":hover")||b.unflip()},b.setting.speed+150)},attachEvents:function(){var b=this;"click"===b.setting.trigger?b.element.on(a.fn.tap?"tap.flip":"click.flip",a.proxy(b.clickHandler,b)):"hover"===b.setting.trigger&&(b.element.on("mouseenter.flip",a.proxy(b.hoverHandler,b)),b.element.on("mouseleave.flip",a.proxy(b.unflip,b)))},flipChanged:function(a){this.fireEvents(["flip:change"]),"function"==typeof a&&a.call(this.element)},changeSettings:function(a,b){var c=this,d=!1;if(void 0!==a.axis&&c.setting.axis!==a.axis.toLowerCase()&&(c.setting.axis=a.axis.toLowerCase(),d=!0),void 0!==a.reverse&&c.setting.reverse!==a.reverse&&(c.setting.reverse=a.reverse,d=!0),d){var e=c.frontElement.add(c.backElement),f=e.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);e.css({transition:"none"});var g="rotate"+c.setting.axis;c.isFlipped?c.frontElement.css({transform:g+(c.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):c.backElement.css({transform:g+(c.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout(function(){e.css(f),c.flipChanged(b)},0)}else c.flipChanged(b)}}),a.fn.flip=function(b,d){return"function"==typeof b&&(d=b),"string"==typeof b||"boolean"==typeof b?this.each(function(){var c=a(this).data("flip-model");"toggle"===b&&(b=!c.isFlipped),b?c.flip(d):c.unflip(d)}):this.each(function(){if(a(this).data("flip-model")){var e=a(this).data("flip-model");!b||void 0===b.axis&&void 0===b.reverse||e.changeSettings(b,d)}else a(this).data("flip-model",new c(a(this),b||{},d))}),this}}(jQuery); //# sourceMappingURL=jquery.flip.min.js.map \ No newline at end of file diff --git a/dist/jquery.flip.min.js.map b/dist/jquery.flip.min.js.map index fde9dee..e1c027f 100644 --- a/dist/jquery.flip.min.js.map +++ b/dist/jquery.flip.min.js.map @@ -1 +1 @@ -{"version":3,"file":"dist/jquery.flip.min.js","sources":["src/flip.js"],"names":["$","whichTransitionEvent","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","Flip","$el","options","callback","this","setting","axis","reverse","trigger","speed","forceHeight","forceWidth","autoSize","front","back","extend","toLowerCase","parseInt","isNaN","element","frontElement","getFrontElement","backElement","getBackElement","isFlipped","init","prototype","flipDone","self","one","call","flip","rotateAxis","css","transform","z-index","unflip","find","faces","add","perspective","elementCss","position","backElementCss","faceElementCss","backface-visibility","transform-style","outerHeight","height","outerWidth","width","window","chrome","Intl","v8BreakIterator","setTimeout","speedInSec","attachEvents","clickHandler","event","target","closest","length","hoverHandler","off","on","proxy","is","fn","tap","flipChanged","changeSettings","changeNeeded","savedTrans","each","data","jQuery"],"mappings":";;;;CAAC,SAAUA,GAMT,GAAIC,GAAuB,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MAhCuB,kBAAZD,KACTC,EAAWD,GAGU,gBAAZA,IAA2C,iBAAZA,GACxCE,KAAKsE,KAAK,WACR,GAAI3C,GAAO5C,EAAEiB,MAAMuE,KAAK,aAER,YAAZzE,IACFA,GAAW6B,EAAKP,WAGdtB,EACF6B,EAAKA,KAAK5B,GAEV4B,EAAKK,OAAOjC,KAIhBC,KAAKsE,KAAK,WACR,GAAIvF,EAAEiB,MAAMuE,KAAK,cAAe,CAC9B,GAAI5C,GAAO5C,EAAEiB,MAAMuE,KAAK,eAEpBzE,GAA6BJ,SAAjBI,EAAQI,MAA0CR,SAApBI,EAAQK,SACpDwB,EAAKwC,eAAerE,EAASC,OAG/BhB,GAAEiB,MAAMuE,KAAK,aAAc,GAAI3E,GAAKb,EAAEiB,MAAQF,MAAgBC,MAK7DC,OAGRwE"} \ No newline at end of file +{"version":3,"file":"dist/jquery.flip.min.js","sources":["src/flip.js"],"names":["$","whichTransitionEvent","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","Flip","$el","options","callback","this","setting","axis","reverse","trigger","speed","forceHeight","forceWidth","autoSize","front","back","extend","toLowerCase","parseInt","isNaN","element","frontElement","getFrontElement","backElement","getBackElement","isFlipped","init","prototype","flip","fireEvents","rotateAxis","css","transform","z-index","onTransitionFinished","unflip","eventsToTrigger","self","one","call","events","each","index","event","find","faces","add","perspective","elementCss","position","backElementCss","faceElementCss","backface-visibility","transform-style","outerHeight","height","outerWidth","width","window","chrome","Intl","v8BreakIterator","setTimeout","speedInSec","attachEvents","clickHandler","target","closest","length","hoverHandler","off","on","proxy","is","fn","tap","flipChanged","changeSettings","changeNeeded","savedTrans","data","jQuery"],"mappings":";;;;CAAC,SAAUA,GAMT,GAAIC,GAAuB,WACzB,GAAIC,GAAGC,EAAKC,SAASC,cAAc,eACnCC,GACEC,WAAoB,gBACpBC,YAAoB,iBACpBC,cAAoB,gBACpBC,iBAAoB,sBAGtB,KAAKR,IAAKI,GACR,GAAoBK,SAA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YxE,MASvBhB,EAAEsF,GAAG9C,KAAO,SAAUzB,EAASC,GAiC7B,MAhCuB,kBAAZD,KACTC,EAAWD,GAGU,gBAAZA,IAA2C,iBAAZA,GACxCE,KAAKoC,KAAK,WACR,GAAIb,GAAOxC,EAAEiB,MAAM2E,KAAK,aAER,YAAZ7E,IACFA,GAAWyB,EAAKH,WAGdtB,EACFyB,EAAKA,KAAKxB,GAEVwB,EAAKO,OAAO/B,KAIhBC,KAAKoC,KAAK,WACR,GAAIrD,EAAEiB,MAAM2E,KAAK,cAAe,CAC9B,GAAIpD,GAAOxC,EAAEiB,MAAM2E,KAAK,eAEpB7E,GAA6BJ,SAAjBI,EAAQI,MAA0CR,SAApBI,EAAQK,SACpDoB,EAAKiD,eAAe1E,EAASC,OAG/BhB,GAAEiB,MAAM2E,KAAK,aAAc,GAAI/E,GAAKb,EAAEiB,MAAQF,MAAgBC,MAK7DC,OAGR4E"} \ No newline at end of file diff --git a/src/flip.js b/src/flip.js index dfe07b9..88f3ae8 100644 --- a/src/flip.js +++ b/src/flip.js @@ -90,24 +90,14 @@ */ $.extend(Flip.prototype, { - flipDone: function(callback) { - var self = this; - // Providing a nicely wrapped up callback because transform is essentially async - self.element.one(whichTransitionEvent(), function() { - self.element.trigger('flip:done'); - if (typeof callback === 'function') { - callback.call(self.element); - } - }); - }, - flip: function(callback) { if (this.isFlipped) { return; } + this.fireEvents(['flip:start']); this.isFlipped = true; - + var rotateAxis = "rotate" + this.setting.axis; this.frontElement.css({ transform: rotateAxis + (this.setting.reverse ? "(-180deg)" : "(180deg)"), @@ -118,7 +108,7 @@ transform: rotateAxis + "(0deg)", "z-index": "1" }); - this.flipDone(callback); + this.transitionFinished(callback, ['flip:done']); }, unflip: function(callback) { @@ -126,6 +116,7 @@ return; } + this.fireEvents(['unflip:start']); this.isFlipped = false; var rotateAxis = "rotate" + this.setting.axis; @@ -138,7 +129,25 @@ transform: rotateAxis + (this.setting.reverse ? "(180deg)" : "(-180deg)"), "z-index": "0" }); - this.flipDone(callback); + this.transitionFinished(callback, ['flip:done', 'unflip:done']); + }, + + transitionFinished: function(callback, eventsToTrigger){ + var self = this; + // Providing a nicely wrapped up callback because transform is essentially async + self.element.one(whichTransitionEvent(), function() { + self.fireEvents(eventsToTrigger); + if (typeof callback === 'function') { + callback.call(self.element); + } + }); + }, + + fireEvents: function(events){ + var self = this; + $.each(events, function(index, event) { + self.element.trigger(event); + }); }, getFrontElement: function() { @@ -269,7 +278,7 @@ }, flipChanged: function(callback) { - this.element.trigger('flip:change'); + this.fireEvents(['flip:change']); if (typeof callback === 'function') { callback.call(this.element); } From d8294286d9f369a9fedcae3b978a441c86191370 Mon Sep 17 00:00:00 2001 From: amador Date: Tue, 27 Mar 2018 15:40:16 +0200 Subject: [PATCH 2/3] Fix typo in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 73d2cc7..fd16dda 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ * Probably the best way for us to get a handle on what's going on is you providing us with a short example using something like a [JSFiddle](http://jsfiddle.net/). ##### Stick around - * If you're interested in getting your changes in and/or issue resolved, it's extremely likely you're going to have to have some discussion about it before that happens. So don't just drop something on us and leave and expect that something will come of it. + * If you're interested in getting your changes in and/or issue resolved, it's extremely likely you're going to have some discussion about it before that happens. So don't just drop something on us and leave and expect that something will come of it. ##### Discussion before code * If you don't want to waste your time writing code that might not be used, it's probably best to make an issue and discuss it with us first before you start writing. From a629315f3f129394d80f6306b770b1ef1ed41449 Mon Sep 17 00:00:00 2001 From: amador Date: Tue, 27 Mar 2018 15:46:07 +0200 Subject: [PATCH 3/3] Refactoring: - Change function name --- dist/jquery.flip.js | 6 +++--- dist/jquery.flip.min.js | 2 +- dist/jquery.flip.min.js.map | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/jquery.flip.js b/dist/jquery.flip.js index 7974c7b..d064f51 100644 --- a/dist/jquery.flip.js +++ b/dist/jquery.flip.js @@ -111,7 +111,7 @@ transform: rotateAxis + "(0deg)", "z-index": "1" }); - this.onTransitionFinished(callback, ['flip:done']); + this.transitionFinished(callback, ['flip:done']); }, unflip: function(callback) { @@ -132,10 +132,10 @@ transform: rotateAxis + (this.setting.reverse ? "(180deg)" : "(-180deg)"), "z-index": "0" }); - this.onTransitionFinished(callback, ['flip:done', 'unflip:done']); + this.transitionFinished(callback, ['flip:done', 'unflip:done']); }, - onTransitionFinished: function(callback, eventsToTrigger){ + transitionFinished: function(callback, eventsToTrigger){ var self = this; // Providing a nicely wrapped up callback because transform is essentially async self.element.one(whichTransitionEvent(), function() { diff --git a/dist/jquery.flip.min.js b/dist/jquery.flip.min.js index e78bf53..c344fb0 100644 --- a/dist/jquery.flip.min.js +++ b/dist/jquery.flip.min.js @@ -2,5 +2,5 @@ * https://github.com/nnattawat/flip * Copyright (c) 2018 Nattawat Nonsung; Licensed MIT */ -!function(a){var b=function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(void 0!==b.style[a])return c[a]},c=function(b,c,d){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=a.extend(this.setting,c),"string"!=typeof c.axis||"x"!==c.axis.toLowerCase()&&"y"!==c.axis.toLowerCase()||(this.setting.axis=c.axis.toLowerCase()),"boolean"==typeof c.reverse&&(this.setting.reverse=c.reverse),"string"==typeof c.trigger&&(this.setting.trigger=c.trigger.toLowerCase());var e=parseInt(c.speed);isNaN(e)||(this.setting.speed=e),"boolean"==typeof c.forceHeight&&(this.setting.forceHeight=c.forceHeight),"boolean"==typeof c.forceWidth&&(this.setting.forceWidth=c.forceWidth),"boolean"==typeof c.autoSize&&(this.setting.autoSize=c.autoSize),("string"==typeof c.front||c.front instanceof a)&&(this.setting.front=c.front),("string"==typeof c.back||c.back instanceof a)&&(this.setting.back=c.back),this.element=b,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(d)};a.extend(c.prototype,{flip:function(a){if(!this.isFlipped){this.fireEvents(["flip:start"]),this.isFlipped=!0;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:b+"(0deg)","z-index":"1"}),this.onTransitionFinished(a,["flip:done"])}},unflip:function(a){if(this.isFlipped){this.fireEvents(["unflip:start"]),this.isFlipped=!1;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+"(0deg)","z-index":"1"}),this.backElement.css({transform:b+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.onTransitionFinished(a,["flip:done","unflip:done"])}},onTransitionFinished:function(a,c){var d=this;d.element.one(b(),function(){d.fireEvents(c),"function"==typeof a&&a.call(d.element)})},fireEvents:function(b){var c=this;a.each(b,function(a,b){c.element.trigger(b)})},getFrontElement:function(){return this.setting.front instanceof a?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof a?this.setting.back:this.element.find(this.setting.back)},init:function(a){var b=this,c=b.frontElement.add(b.backElement),d="rotate"+b.setting.axis,e=2*b.element["outer"+("rotatex"===d?"Height":"Width")](),f={perspective:e,position:"relative"},g={transform:d+"("+(b.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},h={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};b.setting.forceHeight?c.outerHeight(b.element.height()):b.setting.autoSize&&(h.height="100%"),b.setting.forceWidth?c.outerWidth(b.element.width()):b.setting.autoSize&&(h.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(f["-webkit-transform-style"]="preserve-3d"),c.css(h).find("*").css({"backface-visibility":"hidden"}),b.element.css(f),b.backElement.css(g),setTimeout(function(){var d=b.setting.speed/1e3||.5;c.css({transition:"all "+d+"s ease-out"}),"function"==typeof a&&a.call(b.element)},20),b.attachEvents()},clickHandler:function(b){b||(b=window.event),this.element.find(a(b.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var b=this;b.element.off("mouseleave.flip"),b.flip(),setTimeout(function(){b.element.on("mouseleave.flip",a.proxy(b.unflip,b)),b.element.is(":hover")||b.unflip()},b.setting.speed+150)},attachEvents:function(){var b=this;"click"===b.setting.trigger?b.element.on(a.fn.tap?"tap.flip":"click.flip",a.proxy(b.clickHandler,b)):"hover"===b.setting.trigger&&(b.element.on("mouseenter.flip",a.proxy(b.hoverHandler,b)),b.element.on("mouseleave.flip",a.proxy(b.unflip,b)))},flipChanged:function(a){this.fireEvents(["flip:change"]),"function"==typeof a&&a.call(this.element)},changeSettings:function(a,b){var c=this,d=!1;if(void 0!==a.axis&&c.setting.axis!==a.axis.toLowerCase()&&(c.setting.axis=a.axis.toLowerCase(),d=!0),void 0!==a.reverse&&c.setting.reverse!==a.reverse&&(c.setting.reverse=a.reverse,d=!0),d){var e=c.frontElement.add(c.backElement),f=e.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);e.css({transition:"none"});var g="rotate"+c.setting.axis;c.isFlipped?c.frontElement.css({transform:g+(c.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):c.backElement.css({transform:g+(c.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout(function(){e.css(f),c.flipChanged(b)},0)}else c.flipChanged(b)}}),a.fn.flip=function(b,d){return"function"==typeof b&&(d=b),"string"==typeof b||"boolean"==typeof b?this.each(function(){var c=a(this).data("flip-model");"toggle"===b&&(b=!c.isFlipped),b?c.flip(d):c.unflip(d)}):this.each(function(){if(a(this).data("flip-model")){var e=a(this).data("flip-model");!b||void 0===b.axis&&void 0===b.reverse||e.changeSettings(b,d)}else a(this).data("flip-model",new c(a(this),b||{},d))}),this}}(jQuery); +!function(a){var b=function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(void 0!==b.style[a])return c[a]},c=function(b,c,d){this.setting={axis:"y",reverse:!1,trigger:"click",speed:500,forceHeight:!1,forceWidth:!1,autoSize:!0,front:".front",back:".back"},this.setting=a.extend(this.setting,c),"string"!=typeof c.axis||"x"!==c.axis.toLowerCase()&&"y"!==c.axis.toLowerCase()||(this.setting.axis=c.axis.toLowerCase()),"boolean"==typeof c.reverse&&(this.setting.reverse=c.reverse),"string"==typeof c.trigger&&(this.setting.trigger=c.trigger.toLowerCase());var e=parseInt(c.speed);isNaN(e)||(this.setting.speed=e),"boolean"==typeof c.forceHeight&&(this.setting.forceHeight=c.forceHeight),"boolean"==typeof c.forceWidth&&(this.setting.forceWidth=c.forceWidth),"boolean"==typeof c.autoSize&&(this.setting.autoSize=c.autoSize),("string"==typeof c.front||c.front instanceof a)&&(this.setting.front=c.front),("string"==typeof c.back||c.back instanceof a)&&(this.setting.back=c.back),this.element=b,this.frontElement=this.getFrontElement(),this.backElement=this.getBackElement(),this.isFlipped=!1,this.init(d)};a.extend(c.prototype,{flip:function(a){if(!this.isFlipped){this.fireEvents(["flip:start"]),this.isFlipped=!0;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+(this.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}),this.backElement.css({transform:b+"(0deg)","z-index":"1"}),this.transitionFinished(a,["flip:done"])}},unflip:function(a){if(this.isFlipped){this.fireEvents(["unflip:start"]),this.isFlipped=!1;var b="rotate"+this.setting.axis;this.frontElement.css({transform:b+"(0deg)","z-index":"1"}),this.backElement.css({transform:b+(this.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),this.transitionFinished(a,["flip:done","unflip:done"])}},transitionFinished:function(a,c){var d=this;d.element.one(b(),function(){d.fireEvents(c),"function"==typeof a&&a.call(d.element)})},fireEvents:function(b){var c=this;a.each(b,function(a,b){c.element.trigger(b)})},getFrontElement:function(){return this.setting.front instanceof a?this.setting.front:this.element.find(this.setting.front)},getBackElement:function(){return this.setting.back instanceof a?this.setting.back:this.element.find(this.setting.back)},init:function(a){var b=this,c=b.frontElement.add(b.backElement),d="rotate"+b.setting.axis,e=2*b.element["outer"+("rotatex"===d?"Height":"Width")](),f={perspective:e,position:"relative"},g={transform:d+"("+(b.setting.reverse?"180deg":"-180deg")+")","z-index":"0",position:"relative"},h={"backface-visibility":"hidden","transform-style":"preserve-3d",position:"absolute","z-index":"1"};b.setting.forceHeight?c.outerHeight(b.element.height()):b.setting.autoSize&&(h.height="100%"),b.setting.forceWidth?c.outerWidth(b.element.width()):b.setting.autoSize&&(h.width="100%"),(window.chrome||window.Intl&&Intl.v8BreakIterator)&&"CSS"in window&&(f["-webkit-transform-style"]="preserve-3d"),c.css(h).find("*").css({"backface-visibility":"hidden"}),b.element.css(f),b.backElement.css(g),setTimeout(function(){var d=b.setting.speed/1e3||.5;c.css({transition:"all "+d+"s ease-out"}),"function"==typeof a&&a.call(b.element)},20),b.attachEvents()},clickHandler:function(b){b||(b=window.event),this.element.find(a(b.target).closest('button, a, input[type="submit"]')).length||(this.isFlipped?this.unflip():this.flip())},hoverHandler:function(){var b=this;b.element.off("mouseleave.flip"),b.flip(),setTimeout(function(){b.element.on("mouseleave.flip",a.proxy(b.unflip,b)),b.element.is(":hover")||b.unflip()},b.setting.speed+150)},attachEvents:function(){var b=this;"click"===b.setting.trigger?b.element.on(a.fn.tap?"tap.flip":"click.flip",a.proxy(b.clickHandler,b)):"hover"===b.setting.trigger&&(b.element.on("mouseenter.flip",a.proxy(b.hoverHandler,b)),b.element.on("mouseleave.flip",a.proxy(b.unflip,b)))},flipChanged:function(a){this.fireEvents(["flip:change"]),"function"==typeof a&&a.call(this.element)},changeSettings:function(a,b){var c=this,d=!1;if(void 0!==a.axis&&c.setting.axis!==a.axis.toLowerCase()&&(c.setting.axis=a.axis.toLowerCase(),d=!0),void 0!==a.reverse&&c.setting.reverse!==a.reverse&&(c.setting.reverse=a.reverse,d=!0),d){var e=c.frontElement.add(c.backElement),f=e.css(["transition-property","transition-timing-function","transition-duration","transition-delay"]);e.css({transition:"none"});var g="rotate"+c.setting.axis;c.isFlipped?c.frontElement.css({transform:g+(c.setting.reverse?"(-180deg)":"(180deg)"),"z-index":"0"}):c.backElement.css({transform:g+(c.setting.reverse?"(180deg)":"(-180deg)"),"z-index":"0"}),setTimeout(function(){e.css(f),c.flipChanged(b)},0)}else c.flipChanged(b)}}),a.fn.flip=function(b,d){return"function"==typeof b&&(d=b),"string"==typeof b||"boolean"==typeof b?this.each(function(){var c=a(this).data("flip-model");"toggle"===b&&(b=!c.isFlipped),b?c.flip(d):c.unflip(d)}):this.each(function(){if(a(this).data("flip-model")){var e=a(this).data("flip-model");!b||void 0===b.axis&&void 0===b.reverse||e.changeSettings(b,d)}else a(this).data("flip-model",new c(a(this),b||{},d))}),this}}(jQuery); //# sourceMappingURL=jquery.flip.min.js.map \ No newline at end of file diff --git a/dist/jquery.flip.min.js.map b/dist/jquery.flip.min.js.map index e1c027f..43294d1 100644 --- a/dist/jquery.flip.min.js.map +++ b/dist/jquery.flip.min.js.map @@ -1 +1 @@ -{"version":3,"file":"dist/jquery.flip.min.js","sources":["src/flip.js"],"names":["$","whichTransitionEvent","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","Flip","$el","options","callback","this","setting","axis","reverse","trigger","speed","forceHeight","forceWidth","autoSize","front","back","extend","toLowerCase","parseInt","isNaN","element","frontElement","getFrontElement","backElement","getBackElement","isFlipped","init","prototype","flip","fireEvents","rotateAxis","css","transform","z-index","onTransitionFinished","unflip","eventsToTrigger","self","one","call","events","each","index","event","find","faces","add","perspective","elementCss","position","backElementCss","faceElementCss","backface-visibility","transform-style","outerHeight","height","outerWidth","width","window","chrome","Intl","v8BreakIterator","setTimeout","speedInSec","attachEvents","clickHandler","target","closest","length","hoverHand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AAKhB,aAAaU,KAChBC,UAAWF,GAAcO,EAAK/B,QAAQE,QAAU,YAAc,YAC9DyB,UAAW,MAGbI,EAAKd,YAAYQ,KACfC,UAAWF,GAAcO,EAAK/B,QAAQE,QAAU,WAAa,aAC7DyB,UAAW,MAIf6B,WAAW,WACTjB,EAAMd,IAAIgD,GACV1C,EAAKuC,YAAYxE,IAChB,OAGHiC,GAAKuC,YAAYxE,MASvBhB,EAAEsF,GAAG9C,KAAO,SAAUzB,EAASC,GAiC7B,MAhCuB,kBAAZD,KACTC,EAAWD,GAGU,gBAAZA,IAA2C,iBAAZA,GACxCE,KAAKoC,KAAK,WACR,GAAIb,GAAOxC,EAAEiB,MAAM2E,KAAK,aAER,YAAZ7E,IACFA,GAAWyB,EAAKH,WAGdtB,EACFyB,EAAKA,KAAKxB,GAEVwB,EAAKO,OAAO/B,KAIhBC,KAAKoC,KAAK,WACR,GAAIrD,EAAEiB,MAAM2E,KAAK,cAAe,CAC9B,GAAIpD,GAAOxC,EAAEiB,MAAM2E,KAAK,eAEpB7E,GAA6BJ,SAAjBI,EAAQI,MAA0CR,SAApBI,EAAQK,SACpDoB,EAAKiD,eAAe1E,EAASC,OAG/BhB,GAAEiB,MAAM2E,KAAK,aAAc,GAAI/E,GAAKb,EAAEiB,MAAQF,MAAgBC,MAK7DC,OAGR4E"} \ No newline at end of file +{"version":3,"file":"dist/jquery.flip.min.js","sources":["src/flip.js"],"names":["$","whichTransitionEvent","t","el","document","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","undefined","style","Flip","$el","options","callback","this","setting","axis","reverse","trigger","speed","forceHeight","forceWidth","autoSize","front","back","extend","toLowerCase","parseInt","isNaN","element","frontElement","getFrontElement","backElement","getBackElement","isFlipped","init","prototype","flip","fireEvents","rotateAxis","css","transform","z-index","transitionFinished","unflip","eventsToTrigger","self","one","call","events","each","index","event","find","faces","add","perspective","elementCss","position","backElementCss","faceElementCss","backface-visibility","transform-style","outerHeight","height","outerWidth","width","window","chrome","Intl","v8BreakIterator","setTimeout","speedInSec","attachEvents","clickHandler","target","closest","length","hoverHandler","off","on","proxy","is","fn","tap","flipChanged","changeSettings","changeNeeded","savedTrans","data","jQuery"],"mappings":";;;;CAAC,SAAUA,GAMT,GAAIC,GAAuB,WACzB,GAAIC,GAAGC,EAAKC,SAASC,cAAc,eACnCC,GACEC,WAAoB,gBACpBC,YAAoB,iBACpBC,cAAoB,gBACpBC,iBAAoB,sBAGtB,KAAKR,IAAKI,GACR,GAAoBK,SAAhBR,EAAGS,MAAMV,GACX,MAAOI,GAAYJ,IAQrBW,EAAO,SAASC,EAAKC,EAASC,GAEhCC,KAAKC,SACHC,KAAM,IACNC,SAAS,EACTC,QAAS,QACTC,MAAO,IACPC,aAAa,EACbC,YAAY,EACZC,UAAU,EACVC,MAAO,SACPC,KAAM,SAGRV,KAAKC,QAAUlB,EAAE4B,OAAOX,KAAKC,QAASH,GAEV,gBAAjBA,GAAQI,MAAqD,MAA/BJ,EAAQI,KAAKU,eAAwD,MAA/Bd,EAAQI,KAAKU,gBAC1FZ,KAAKC,QAAQC,KAAOJ,EAAQI,KAAKU,eAGJ,iBAApBd,GAAQK,UACjBH,KAAKC,QAAQE,QAAUL,EAAQK,SAGF,gBAApBL,GAAQM,UACjBJ,KAAKC,QAAQG,QAAUN,EAAQM,QAAQQ,cAGzC,IAAIP,GAAQQ,SAASf,EAAQO,MACxBS,OAAMT,KACTL,KAAKC,QAAQI,MAAQA,GAGY,iBAAxBP,GAAQQ,cACjBN,KAAKC,QAAQK,YAAcR,EAAQQ,aAGH,iBAAvBR,GAAQS,aACjBP,KAAKC,QAAQM,WAAaT,EAAQS,YAGJ,iBAArBT,GAAQU,WACjBR,KAAKC,QAAQO,SAAWV,EAAQU,WAGL,gBAAlBV,GAAQW,OAAsBX,EAAQW,gBAAiB1B,MAChEiB,KAAKC,QAAQQ,MAAQX,EAAQW,QAGH,gBAAjBX,GAAQY,MAAqBZ,EAAQY,eAAgB3B,MAC9DiB,KAAKC,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