From 4305f7232febeed02eb45759db05f434c7408ac9 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Fri, 2 Aug 2013 19:08:36 -0400 Subject: [PATCH] transition buildP Former-commit-id: 158bcbba133990b8d5b38d00a458bd9698896644 Former-commit-id: f5622eda42bfb7fbbc42f1f0709927b9caaf5692 --- build/minified/modules/transition.js | 61 +++++++++++++------ build/minified/modules/transition.min.js | 2 +- build/packaged/modules/transition.js | 61 +++++++++++++------ build/packaged/semantic.min.js.REMOVED.git-id | 2 +- build/uncompressed/modules/transition.js | 61 +++++++++++++------ .../components/semantic/modules/transition.js | 61 +++++++++++++------ .../library/jquery.js.REMOVED.git-id | 2 +- 7 files changed, 167 insertions(+), 83 deletions(-) diff --git a/build/minified/modules/transition.js b/build/minified/modules/transition.js index 5b46a3ae9..96044e0f3 100644 --- a/build/minified/modules/transition.js +++ b/build/minified/modules/transition.js @@ -19,8 +19,14 @@ $.fn.transition = function() { moduleArguments = arguments, query = moduleArguments[0], - methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), + methodInvoked = (typeof query == 'string'), + + requestAnimationFrame = window.requestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || window.msRequestAnimationFrame + || function(callback) { setTimeout(callback, 0); }, invokedResponse ; @@ -37,6 +43,7 @@ $.fn.transition = function() { error, className, metadata, + transitionEnd, namespace, moduleNamespace, @@ -57,6 +64,8 @@ $.fn.transition = function() { metadata = settings.metadata; moduleNamespace = 'module-' + namespace; + transitionEnd = module.get.transitionEvent(); + instance = $module.data(moduleNamespace); if(instance === undefined) { @@ -207,15 +216,18 @@ $.fn.transition = function() { }, hide: function() { - module.debug('Hiding element'); + module.verbose('Hiding element'); $module .addClass(className.transition) .addClass(className.hidden) ; }, show: function() { - module.debug('Showing element'); - $module.removeClass(className.hidden); + module.verbose('Showing element'); + $module + .removeClass(className.transition) + .removeClass(className.hidden) + ; }, start: function() { @@ -233,52 +245,60 @@ $.fn.transition = function() { $module.toggleClass(className.disabled); }, - animate: function(animation) { - animation = animation || settings.animation; + animate: function(overrideSettings) { + settings = overrideSettings || settings; if(!module.can.animate()) { - module.error(error.noAnimation, animation); + module.error(error.noAnimation, settings.animation); return false; } if(module.is.animating()) { - module.queue(animation); + module.queue(settings.animation); return false; } module.set.animating(); module.set.duration(); module.debug('Beginning animation', settings.animation); - module.show(); module.originalClass = $module.attr('class'); $module .addClass(className.transition) .addClass(settings.animation) - .one( module.get.transitionEvent(), function() { - module.reset(); - settings.complete(); - }) + .one(transitionEnd, module.complete) ; }, queue: function(animation) { module.debug('Queueing animation of', animation); $module - .one(module.get.transitionEvent(), function() { - module.debug('Executing queued animation', animation); - $module.transition.apply(element, moduleArguments); + .one(transitionEnd, function() { + module.animate.apply(this, settings); }) ; }, - reset: function () { - module.verbose('Resetting animation conditions'); + reset: function() { + module.verbose('Resetting original class', module.originalClass); $module .removeAttr('style') .attr('class', module.originalClass) ; - if($module.hasClass(className.out)) { + }, + + complete: function () { + module.verbose('CSS animation complete', settings.animation); + if($module.hasClass(className.outward)) { + module.reset(); module.hide(); } + else if($module.hasClass(className.inward)) { + module.reset(); + module.show(); + } + else { + module.reset(); + } module.remove.animating(); module.repaint(); + settings.complete(); }, setting: function(name, value) { @@ -451,7 +471,8 @@ $.fn.transition.settings = { className : { transition : 'ui transition', - out : 'out', + inward : 'in', + outward : 'out', hidden : 'hidden', disabled : 'disabled' }, diff --git a/build/minified/modules/transition.min.js b/build/minified/modules/transition.min.js index 26112a409..8b112ed03 100644 --- a/build/minified/modules/transition.min.js +++ b/build/minified/modules/transition.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.transition=function(){var b,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments,j=i[0],k="string"==typeof j,l=[].slice.call(arguments,1);return e.each(function(){var e,m,n,o,p,q,r,s,t=a(this),u=this;s={initialize:function(){e=s.get.settings.apply(u,i),s.verbose("Converted arguments into settings object",e),n=e.error,o=e.className,q=e.namespace,p=e.metadata,r="module-"+q,m=t.data(r),m===d&&s.instantiate(),k&&(b=s.invoke(j)),k&&b!==!1||s.animate()},instantiate:function(){s.verbose("Storing instance of module",s),m=s,t.data(r,m)},destroy:function(){s.verbose("Destroying previous module for",u),t.removeData(r)},repaint:function(a){s.verbose("Forcing repaint event"),a=u.offsetWidth},set:{animating:function(){t.data(p.animating,!0)},duration:function(a){a=a||e.duration,s.verbose("Setting animation duration",a),t.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},remove:{animating:function(){t.data(p.animating,!1)}},get:{settings:function(b,c,e){return a.isPlainObject(b)===d?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof e?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:e,duration:c}):"string"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend(!0,{},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:c}):a.extend(!0,{},a.fn.transition.settings,{animation:b})},transitionEvent:function(){var a,b=c.createElement("element"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return s.verbose("Determining animation end event",e[a]),e[a];return!1}},can:{animate:function(b){var c=a("
");return b=b||e.animation,c.addClass(o.transition).addClass(b),"none"!==c.css("animationName")}},is:{animating:function(){return t.data(p.animating)||!1}},hide:function(){s.debug("Hiding element"),t.addClass(o.transition).addClass(o.hidden)},show:function(){s.debug("Showing element"),t.removeClass(o.hidden)},start:function(){s.verbose("Starting animation"),t.removeClass(o.disabled)},stop:function(){s.debug("Stopping animation"),t.addClass(o.disabled)},toggle:function(){s.debug("Toggling play status"),t.toggleClass(o.disabled)},animate:function(a){return a=a||e.animation,s.can.animate()?s.is.animating()?(s.queue(a),!1):(s.set.animating(),s.set.duration(),s.debug("Beginning animation",e.animation),s.show(),s.originalClass=t.attr("class"),t.addClass(o.transition).addClass(e.animation).one(s.get.transitionEvent(),function(){s.reset(),e.complete()}),void 0):(s.error(n.noAnimation,a),!1)},queue:function(a){s.debug("Queueing animation of",a),t.one(s.get.transitionEvent(),function(){s.debug("Executing queued animation",a),t.transition.apply(u,i)})},reset:function(){s.verbose("Resetting animation conditions"),t.removeAttr("style").attr("class",s.originalClass),t.hasClass(o.out)&&s.hide(),s.remove.animating(),s.repaint()},setting:function(b,c){return c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},internal:function(b,c){return c===d?s[b]:(a.isPlainObject(b)?a.extend(!0,s,b):s[b]=c,void 0)},debug:function(){e.debug&&(e.performance?s.performance.log(arguments):s.debug=Function.prototype.bind.call(console.info,console,e.moduleName+":"))},verbose:function(){e.verbose&&e.debug&&(e.performance?s.performance.log(arguments):s.verbose=Function.prototype.bind.call(console.info,console,e.moduleName+":"))},error:function(){s.error=Function.prototype.bind.call(console.error,console,e.moduleName+":")},performance:{log:function(a){var b,c,d;e.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(s.performance.timer),s.performance.timer=setTimeout(s.performance.display,100)},display:function(){var b=e.moduleName+":",c=0;g=!1,clearTimeout(s.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,e){var f,g,h=m;return c=c||l,e=u||e,"string"==typeof b&&h!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(b,c){return a.isPlainObject(h[c])&&b!=f?(h=h[c],!0):h[c]!==d?(g=h[c],!0):(s.error(n.method),!1)})),a.isFunction(g)?(m.verbose("Executing invoked function",g),g.apply(e,c)):g||!1}},s.initialize()}),b?b:this},a.fn.transition.settings={moduleName:"Transition",debug:!0,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade in",duration:"1s",metadata:{animating:"animating"},className:{transition:"ui transition",out:"out",hidden:"hidden",disabled:"disabled"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.transition=function(){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments,k=j[0],l=[].slice.call(arguments,1),m="string"==typeof k;return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var b,f,n,o,p,q,r,s,t,u=a(this),v=this;t={initialize:function(){b=t.get.settings.apply(v,j),t.verbose("Converted arguments into settings object",b),n=b.error,o=b.className,r=b.namespace,p=b.metadata,s="module-"+r,q=t.get.transitionEvent(),f=u.data(s),f===d&&t.instantiate(),m&&(e=t.invoke(k)),m&&e!==!1||t.animate()},instantiate:function(){t.verbose("Storing instance of module",t),f=t,u.data(s,f)},destroy:function(){t.verbose("Destroying previous module for",v),u.removeData(s)},repaint:function(a){t.verbose("Forcing repaint event"),a=v.offsetWidth},set:{animating:function(){u.data(p.animating,!0)},duration:function(a){a=a||b.duration,t.verbose("Setting animation duration",a),u.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},remove:{animating:function(){u.data(p.animating,!1)}},get:{settings:function(b,c,e){return a.isPlainObject(b)===d?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof e?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:e,duration:c}):"string"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend(!0,{},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:c}):a.extend(!0,{},a.fn.transition.settings,{animation:b})},transitionEvent:function(){var a,b=c.createElement("element"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return t.verbose("Determining animation end event",e[a]),e[a];return!1}},can:{animate:function(c){var d=a("
");return c=c||b.animation,d.addClass(o.transition).addClass(c),"none"!==d.css("animationName")}},is:{animating:function(){return u.data(p.animating)||!1}},hide:function(){t.verbose("Hiding element"),u.addClass(o.transition).addClass(o.hidden)},show:function(){t.verbose("Showing element"),u.removeClass(o.transition).removeClass(o.hidden)},start:function(){t.verbose("Starting animation"),u.removeClass(o.disabled)},stop:function(){t.debug("Stopping animation"),u.addClass(o.disabled)},toggle:function(){t.debug("Toggling play status"),u.toggleClass(o.disabled)},animate:function(a){return b=a||b,t.can.animate()?t.is.animating()?(t.queue(b.animation),!1):(t.set.animating(),t.set.duration(),t.debug("Beginning animation",b.animation),t.originalClass=u.attr("class"),u.addClass(o.transition).addClass(b.animation).one(q,t.complete),void 0):(t.error(n.noAnimation,b.animation),!1)},queue:function(a){t.debug("Queueing animation of",a),u.one(q,function(){t.animate.apply(this,b)})},reset:function(){t.verbose("Resetting original class",t.originalClass),u.removeAttr("style").attr("class",t.originalClass)},complete:function(){t.verbose("CSS animation complete",b.animation),u.hasClass(o.outward)?(t.reset(),t.hide()):u.hasClass(o.inward)?(t.reset(),t.show()):t.reset(),t.remove.animating(),t.repaint(),b.complete()},setting:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},internal:function(b,c){return c===d?t[b]:(a.isPlainObject(b)?a.extend(!0,t,b):t[b]=c,void 0)},debug:function(){b.debug&&(b.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,b.moduleName+":"))},verbose:function(){b.verbose&&b.debug&&(b.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,b.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.error,console,b.moduleName+":")},performance:{log:function(a){var c,d,e;b.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100)},display:function(){var c=b.moduleName+":",e=0;h=!1,clearTimeout(t.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",g&&(c+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,e){var g,h,i=f;return c=c||l,e=v||e,"string"==typeof b&&i!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(b,c){return a.isPlainObject(i[c])&&b!=g?(i=i[c],!0):i[c]!==d?(h=i[c],!0):(t.error(n.method),!1)})),a.isFunction(h)?(f.verbose("Executing invoked function",h),h.apply(e,c)):h||!1}},t.initialize()}),e?e:this},a.fn.transition.settings={moduleName:"Transition",debug:!0,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade in",duration:"1s",metadata:{animating:"animating"},className:{transition:"ui transition",inward:"in",outward:"out",hidden:"hidden",disabled:"disabled"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document); \ No newline at end of file diff --git a/build/packaged/modules/transition.js b/build/packaged/modules/transition.js index 5b46a3ae9..96044e0f3 100644 --- a/build/packaged/modules/transition.js +++ b/build/packaged/modules/transition.js @@ -19,8 +19,14 @@ $.fn.transition = function() { moduleArguments = arguments, query = moduleArguments[0], - methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), + methodInvoked = (typeof query == 'string'), + + requestAnimationFrame = window.requestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || window.msRequestAnimationFrame + || function(callback) { setTimeout(callback, 0); }, invokedResponse ; @@ -37,6 +43,7 @@ $.fn.transition = function() { error, className, metadata, + transitionEnd, namespace, moduleNamespace, @@ -57,6 +64,8 @@ $.fn.transition = function() { metadata = settings.metadata; moduleNamespace = 'module-' + namespace; + transitionEnd = module.get.transitionEvent(); + instance = $module.data(moduleNamespace); if(instance === undefined) { @@ -207,15 +216,18 @@ $.fn.transition = function() { }, hide: function() { - module.debug('Hiding element'); + module.verbose('Hiding element'); $module .addClass(className.transition) .addClass(className.hidden) ; }, show: function() { - module.debug('Showing element'); - $module.removeClass(className.hidden); + module.verbose('Showing element'); + $module + .removeClass(className.transition) + .removeClass(className.hidden) + ; }, start: function() { @@ -233,52 +245,60 @@ $.fn.transition = function() { $module.toggleClass(className.disabled); }, - animate: function(animation) { - animation = animation || settings.animation; + animate: function(overrideSettings) { + settings = overrideSettings || settings; if(!module.can.animate()) { - module.error(error.noAnimation, animation); + module.error(error.noAnimation, settings.animation); return false; } if(module.is.animating()) { - module.queue(animation); + module.queue(settings.animation); return false; } module.set.animating(); module.set.duration(); module.debug('Beginning animation', settings.animation); - module.show(); module.originalClass = $module.attr('class'); $module .addClass(className.transition) .addClass(settings.animation) - .one( module.get.transitionEvent(), function() { - module.reset(); - settings.complete(); - }) + .one(transitionEnd, module.complete) ; }, queue: function(animation) { module.debug('Queueing animation of', animation); $module - .one(module.get.transitionEvent(), function() { - module.debug('Executing queued animation', animation); - $module.transition.apply(element, moduleArguments); + .one(transitionEnd, function() { + module.animate.apply(this, settings); }) ; }, - reset: function () { - module.verbose('Resetting animation conditions'); + reset: function() { + module.verbose('Resetting original class', module.originalClass); $module .removeAttr('style') .attr('class', module.originalClass) ; - if($module.hasClass(className.out)) { + }, + + complete: function () { + module.verbose('CSS animation complete', settings.animation); + if($module.hasClass(className.outward)) { + module.reset(); module.hide(); } + else if($module.hasClass(className.inward)) { + module.reset(); + module.show(); + } + else { + module.reset(); + } module.remove.animating(); module.repaint(); + settings.complete(); }, setting: function(name, value) { @@ -451,7 +471,8 @@ $.fn.transition.settings = { className : { transition : 'ui transition', - out : 'out', + inward : 'in', + outward : 'out', hidden : 'hidden', disabled : 'disabled' }, diff --git a/build/packaged/semantic.min.js.REMOVED.git-id b/build/packaged/semantic.min.js.REMOVED.git-id index 13bda3041..7c11e86ac 100644 --- a/build/packaged/semantic.min.js.REMOVED.git-id +++ b/build/packaged/semantic.min.js.REMOVED.git-id @@ -1 +1 @@ -d3046cbf6d1307a8536e7b2aff1e43958e6cd538 \ No newline at end of file +6e36c214abb9906bac0ad17a78b8c977dcfefb17 \ No newline at end of file diff --git a/build/uncompressed/modules/transition.js b/build/uncompressed/modules/transition.js index 5b46a3ae9..96044e0f3 100644 --- a/build/uncompressed/modules/transition.js +++ b/build/uncompressed/modules/transition.js @@ -19,8 +19,14 @@ $.fn.transition = function() { moduleArguments = arguments, query = moduleArguments[0], - methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), + methodInvoked = (typeof query == 'string'), + + requestAnimationFrame = window.requestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || window.msRequestAnimationFrame + || function(callback) { setTimeout(callback, 0); }, invokedResponse ; @@ -37,6 +43,7 @@ $.fn.transition = function() { error, className, metadata, + transitionEnd, namespace, moduleNamespace, @@ -57,6 +64,8 @@ $.fn.transition = function() { metadata = settings.metadata; moduleNamespace = 'module-' + namespace; + transitionEnd = module.get.transitionEvent(); + instance = $module.data(moduleNamespace); if(instance === undefined) { @@ -207,15 +216,18 @@ $.fn.transition = function() { }, hide: function() { - module.debug('Hiding element'); + module.verbose('Hiding element'); $module .addClass(className.transition) .addClass(className.hidden) ; }, show: function() { - module.debug('Showing element'); - $module.removeClass(className.hidden); + module.verbose('Showing element'); + $module + .removeClass(className.transition) + .removeClass(className.hidden) + ; }, start: function() { @@ -233,52 +245,60 @@ $.fn.transition = function() { $module.toggleClass(className.disabled); }, - animate: function(animation) { - animation = animation || settings.animation; + animate: function(overrideSettings) { + settings = overrideSettings || settings; if(!module.can.animate()) { - module.error(error.noAnimation, animation); + module.error(error.noAnimation, settings.animation); return false; } if(module.is.animating()) { - module.queue(animation); + module.queue(settings.animation); return false; } module.set.animating(); module.set.duration(); module.debug('Beginning animation', settings.animation); - module.show(); module.originalClass = $module.attr('class'); $module .addClass(className.transition) .addClass(settings.animation) - .one( module.get.transitionEvent(), function() { - module.reset(); - settings.complete(); - }) + .one(transitionEnd, module.complete) ; }, queue: function(animation) { module.debug('Queueing animation of', animation); $module - .one(module.get.transitionEvent(), function() { - module.debug('Executing queued animation', animation); - $module.transition.apply(element, moduleArguments); + .one(transitionEnd, function() { + module.animate.apply(this, settings); }) ; }, - reset: function () { - module.verbose('Resetting animation conditions'); + reset: function() { + module.verbose('Resetting original class', module.originalClass); $module .removeAttr('style') .attr('class', module.originalClass) ; - if($module.hasClass(className.out)) { + }, + + complete: function () { + module.verbose('CSS animation complete', settings.animation); + if($module.hasClass(className.outward)) { + module.reset(); module.hide(); } + else if($module.hasClass(className.inward)) { + module.reset(); + module.show(); + } + else { + module.reset(); + } module.remove.animating(); module.repaint(); + settings.complete(); }, setting: function(name, value) { @@ -451,7 +471,8 @@ $.fn.transition.settings = { className : { transition : 'ui transition', - out : 'out', + inward : 'in', + outward : 'out', hidden : 'hidden', disabled : 'disabled' }, diff --git a/node/src/files/components/semantic/modules/transition.js b/node/src/files/components/semantic/modules/transition.js index ca0746bbd..96044e0f3 100644 --- a/node/src/files/components/semantic/modules/transition.js +++ b/node/src/files/components/semantic/modules/transition.js @@ -19,8 +19,14 @@ $.fn.transition = function() { moduleArguments = arguments, query = moduleArguments[0], - methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), + methodInvoked = (typeof query == 'string'), + + requestAnimationFrame = window.requestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || window.msRequestAnimationFrame + || function(callback) { setTimeout(callback, 0); }, invokedResponse ; @@ -37,6 +43,7 @@ $.fn.transition = function() { error, className, metadata, + transitionEnd, namespace, moduleNamespace, @@ -57,6 +64,8 @@ $.fn.transition = function() { metadata = settings.metadata; moduleNamespace = 'module-' + namespace; + transitionEnd = module.get.transitionEvent(); + instance = $module.data(moduleNamespace); if(instance === undefined) { @@ -207,15 +216,18 @@ $.fn.transition = function() { }, hide: function() { - module.debug('Hiding element'); + module.verbose('Hiding element'); $module .addClass(className.transition) .addClass(className.hidden) ; }, show: function() { - module.debug('Showing element'); - $module.removeClass(className.hidden); + module.verbose('Showing element'); + $module + .removeClass(className.transition) + .removeClass(className.hidden) + ; }, start: function() { @@ -233,52 +245,60 @@ $.fn.transition = function() { $module.toggleClass(className.disabled); }, - animate: function(animation) { - animation = animation || settings.animation; + animate: function(overrideSettings) { + settings = overrideSettings || settings; if(!module.can.animate()) { - module.error(error.noAnimation, animation); + module.error(error.noAnimation, settings.animation); return false; } if(module.is.animating()) { - module.queue(animation); + module.queue(settings.animation); return false; } module.set.animating(); module.set.duration(); module.debug('Beginning animation', settings.animation); - module.show(); module.originalClass = $module.attr('class'); $module .addClass(className.transition) .addClass(settings.animation) - .one( module.get.transitionEvent(), function() { - // module.reset(); - settings.complete(); - }) + .one(transitionEnd, module.complete) ; }, queue: function(animation) { module.debug('Queueing animation of', animation); $module - .one(module.get.transitionEvent(), function() { - module.debug('Executing queued animation', animation); - $module.transition.apply(element, moduleArguments); + .one(transitionEnd, function() { + module.animate.apply(this, settings); }) ; }, - reset: function () { - module.verbose('Resetting animation conditions'); + reset: function() { + module.verbose('Resetting original class', module.originalClass); $module .removeAttr('style') .attr('class', module.originalClass) ; - if($module.hasClass(className.out)) { + }, + + complete: function () { + module.verbose('CSS animation complete', settings.animation); + if($module.hasClass(className.outward)) { + module.reset(); module.hide(); } + else if($module.hasClass(className.inward)) { + module.reset(); + module.show(); + } + else { + module.reset(); + } module.remove.animating(); module.repaint(); + settings.complete(); }, setting: function(name, value) { @@ -451,7 +471,8 @@ $.fn.transition.settings = { className : { transition : 'ui transition', - out : 'out', + inward : 'in', + outward : 'out', hidden : 'hidden', disabled : 'disabled' }, diff --git a/node/src/files/javascript/library/jquery.js.REMOVED.git-id b/node/src/files/javascript/library/jquery.js.REMOVED.git-id index 187767f33..90041d41b 100644 --- a/node/src/files/javascript/library/jquery.js.REMOVED.git-id +++ b/node/src/files/javascript/library/jquery.js.REMOVED.git-id @@ -1 +1 @@ -39e56d7379c9257e4ee95df22c9acd2fa7fc0cb4 \ No newline at end of file +a3cea5e854c3d2114c28cdbc87cf1bd81dd6ca7d \ No newline at end of file