diff --git a/build/minified/modules/dropdown.js b/build/minified/modules/dropdown.js index ddcbe2ab1..67cfe0e26 100644 --- a/build/minified/modules/dropdown.js +++ b/build/minified/modules/dropdown.js @@ -21,7 +21,6 @@ $.fn.dropdown = function(parameters) { className = settings.className, metadata = settings.metadata, namespace = settings.namespace, - animation = settings.animation, selector = settings.selector, errors = settings.errors, @@ -252,6 +251,9 @@ $.fn.dropdown = function(parameters) { module.debug('Adding selected value to hidden input', value, $input); $input.val(value); }, + visible: function() { + $module.addClass(className.visible); + }, selected: function(value) { var $selectedItem = module.get.item(value), @@ -271,6 +273,12 @@ $.fn.dropdown = function(parameters) { } }, + remove: { + visible: function() { + $module.removeClass(className.visible); + } + }, + is: { visible: function() { return $menu.is(':visible'); @@ -290,21 +298,17 @@ $.fn.dropdown = function(parameters) { }, animate: { - show: function() { + show: function(callback) { module.verbose('Doing menu showing animation'); - if(animation.show == 'none') { - $menu - .show() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.show == 'fade') { - $menu - .hide() - .clearQueue() - .fadeIn(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.show == 'slide') { + else if(settings.animation == 'slide down') { $menu .hide() .clearQueue() @@ -314,30 +318,39 @@ $.fn.dropdown = function(parameters) { .delay(50) .animate({ opacity : 1 - }, 200, 'easeOutQuad', module.event.resetStyle) + }, settings.duration, 'easeOutQuad', module.event.resetStyle) .end() - .slideDown(100, 'easeOutQuad', module.event.resetStyle) + .slideDown(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .hide() + .clearQueue() + .fadeIn(settings.duration, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { module.error(errors.animation); } }, - hide: function() { + hide: function(callback) { module.verbose('Doing menu hiding animation'); - if(animation.hide == 'none') { - $menu - .hide() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.hide == 'fade') { - $menu - .show() - .clearQueue() - .fadeOut(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.hide == 'slide') { + else if(settings.animation == 'slide down') { $menu .show() .clearQueue() @@ -349,7 +362,20 @@ $.fn.dropdown = function(parameters) { }, 100, 'easeOutQuad', module.event.resetStyle) .end() .delay(50) - .slideUp(100, 'easeOutQuad', module.event.resetStyle) + .slideUp(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .show() + .clearQueue() + .fadeOut(150, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { @@ -362,28 +388,22 @@ $.fn.dropdown = function(parameters) { module.debug('Checking if dropdown can show'); if( !module.is.visible() ) { module.hideOthers(); - $module - .addClass(className.visible) - ; - module.animate.show(); + module.animate.show(module.set.visible); if( module.can.click() ) { module.intent.bind(); } - $.proxy(settings.onShow, $module.get() )(); + $.proxy(settings.onShow, element)(); } }, hide: function() { if( !module.is.hidden() ) { module.debug('Hiding dropdown'); - $module - .removeClass(className.visible) - ; if( module.can.click() ) { module.intent.unbind(); } - module.animate.hide(); - $.proxy(settings.onHide, $module.get() )(); + module.animate.hide(module.remove.visible); + $.proxy(settings.onHide, element)(); } }, @@ -589,10 +609,8 @@ $.fn.dropdown.settings = { hide: 300 }, - animation : { - show: 'slide', - hide: 'slide' - }, + animation : 'slide down', + duration : 250, onChange : function(){}, onShow : function(){}, diff --git a/build/minified/modules/dropdown.min.css b/build/minified/modules/dropdown.min.css index 5cb069677..e8861ae29 100644 --- a/build/minified/modules/dropdown.min.css +++ b/build/minified/modules/dropdown.min.css @@ -1 +1 @@ -.ui.dropdown{position:relative;display:inline-block;line-height:1;-webkit-transition:border-radius .1s ease,width .2s ease;-moz-transition:border-radius .1s ease,width .2s ease;-o-transition:border-radius .1s ease,width .2s ease;-ms-transition:border-radius .1s ease,width .2s ease;transition:border-radius .1s ease,width .2s ease}.ui.dropdown .menu{position:absolute;display:none;top:100%;background-color:#FFF;min-width:100%;white-space:nowrap;text-shadow:none;-webkit-box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;-moz-box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;-moz-border-radius:0 0 .325em .325em;-webkit-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;-ms-transition:opacity .2s ease;transition:opacity .2s ease;z-index:11}.ui.dropdown>.dropdown.icon{width:auto}.ui.dropdown>.text{display:inline-block;-webkit-transition:color .2s ease;-moz-transition:color .2s ease;-o-transition:color .2s ease;-ms-transition:color .2s ease;transition:color .2s ease}.ui.dropdown .menu{left:0}.ui.menu .dropdown:last-child .menu,.ui>.ui.dropdown:last-child .menu{left:auto;right:0}.ui.dropdown .menu .item{cursor:pointer;border:0;border-top:1px solid rgba(0,0,0,.05);font-size:.875em;display:block;color:rgba(0,0,0,.75);padding:.85em 1em!important;font-size:.9rem;text-transform:none;font-weight:400;text-align:left;-webkit-touch-callout:none}.ui.dropdown .menu .item:before{display:none}.ui.dropdown .menu .item .icon{margin-right:.75em}.ui.dropdown .menu .item:first-child{border-top:0}.ui.dropdown.visible{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.dropdown.visible .menu{display:block}.ui.dropdown .menu .item:hover{background-color:rgba(0,0,0,.02);z-index:12}.ui.dropdown .menu .active.item{background-color:rgba(0,0,0,.04);border-left:0;z-index:12}.ui.dropdown>.default.text,.ui.default.dropdown>.text{color:rgba(0,0,0,.5)}.ui.dropdown:hover>.default.text,.ui.default.dropdown:hover>.text{color:rgba(0,0,0,.8)}.ui.simple.dropdown .menu:before,.ui.simple.dropdown .menu:after{display:none}.ui.simple.dropdown .menu{display:block;overflow:hidden;top:-9999px!important;position:absolute;opacity:0;-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;-ms-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.ui.simple.dropdown.visible,.ui.simple.dropdown:hover{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.simple.dropdown.visible .menu,.ui.simple.dropdown:hover .menu{overflow:visible;width:auto;height:auto;top:100%!important;opacity:1}.ui.simple.disabled.dropdown:hover .menu{height:0;width:0;overflow:hidden}.ui.selection.dropdown{cursor:pointer;display:inline-block;background-color:#FFF;padding:.5em 1em;line-height:1.33;color:rgba(0,0,0,.8);-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);-webkit-border-radius:.3125em!important;-moz-border-radius:.3125em!important;border-radius:.3125em!important}.ui.selection.dropdown>.dropdown.icon{float:right;opacity:.7;margin:.2em 0 .2em 1.25em;-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;-ms-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.ui.selection.dropdown,.ui.selection.dropdown .menu{top:100%;-webkit-transition:box-shadow .2s ease-out;-moz-transition:box-shadow .2s ease-out;-o-transition:box-shadow .2s ease-out;-ms-transition:box-shadow .2s ease-out;transition:box-shadow .2s ease-out}.ui.selection.dropdown .menu{max-height:312px;overflow-x:hidden;overflow-y:auto;-webkit-box-shadow:0 1px 0 1px #EEE;-moz-box-shadow:0 1px 0 1px #EEE;box-shadow:0 1px 0 1px #EEE;-moz-border-radius:0 0 .325em .325em;-webkit-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em}.ui.selection.dropdown .menu img{height:2.5em;display:inline-block;vertical-align:middle;margin-right:.5em}.ui.selection.dropdown:hover,.ui.selection.dropdown.hover{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.2);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.2);box-shadow:0 0 0 1px rgba(0,0,0,.2)}.ui.selection.dropdown:hover>.dropdown.icon{opacity:1}.ui.selection.dropdown.visible{-webkit-border-radius:.3125em .3125em 0 0!important;-moz-border-radius:.3125em .3125em 0 0!important;border-radius:.3125em .3125em 0 0!important}.ui.selection.dropdown.visible>.dropdown.icon{opacity:1}.ui.selection.dropdown.visible .menu{-webkit-box-shadow:0 1px 0 1px #D3D3D3;-moz-box-shadow:0 1px 0 1px #D3D3D3;box-shadow:0 1px 0 1px #D3D3D3}.ui.fluid.dropdown{display:block}.ui.pointing.dropdown .menu{top:100%;margin-top:.75em;-moz-border-radius:.325em;-webkit-border-radius:.325em;border-radius:.325em}.ui.pointing.dropdown .menu:after{position:absolute;pointer-events:none;content:" ";width:.5em;height:.5em;-moz-box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);-webkit-box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);background-image:none;background-color:#FFF;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);z-index:2}.ui.pointing.dropdown .menu .item.active:first-child{background:transparent -webkit-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -moz-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -o-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -ms-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent linear-gradient(transparent,rgba(0,0,0,.03))}.ui.pointing.dropdown .menu:after{top:-.25em;left:50%;margin:0 0 0 -.25em}.ui.top.left.pointing.dropdown .menu{top:100%;bottom:auto;left:0;right:auto;margin:.75em 0 0}.ui.top.left.pointing.dropdown .menu:after{top:-.25em;left:1em;right:auto;margin:0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}.ui.top.right.pointing.dropdown .menu{top:100%;bottom:auto;right:0;left:auto;margin:.75em 0 0}.ui.top.right.pointing.dropdown .menu:after{top:-.25em;left:auto;right:1em;margin:0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}.ui.left.pointing.dropdown .menu{top:0;left:100%;right:auto;margin:0 0 0 .75em}.ui.left.pointing.dropdown .menu:after{top:1em;left:-.25em;margin:-.1em 0 0 0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);transform:rotate(-45deg)}.ui.right.pointing.dropdown .menu{top:0;left:auto;right:100%;margin:0 .75em 0 0}.ui.right.pointing.dropdown .menu:after{top:1em;left:auto;right:-.25em;margin:-.1em 0 0 0;-webkit-transform:rotate(135deg);-moz-transform:rotate(135deg);transform:rotate(135deg)}.ui.pointing.dropdown.visible,.ui.pointing.dropdown.visible .menu{-moz-border-radius:.325em!important;-webkit-border-radius:.325em!important;border-radius:.325em!important} \ No newline at end of file +.ui.dropdown{position:relative;display:inline-block;line-height:1;-webkit-transition:border-radius .1s ease,width .2s ease;-moz-transition:border-radius .1s ease,width .2s ease;-o-transition:border-radius .1s ease,width .2s ease;-ms-transition:border-radius .1s ease,width .2s ease;transition:border-radius .1s ease,width .2s ease}.ui.dropdown>.menu{position:absolute;display:none;top:100%;margin:0;background-color:#FFF;min-width:100%;white-space:nowrap;font-size:.875em;text-shadow:none;-webkit-box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;-moz-box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;box-shadow:0 0 1px 1px rgba(0,0,0,.1),0 -2px 0 0 rgba(0,0,0,.1) inset;-moz-border-radius:0 0 .325em .325em;-webkit-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;-ms-transition:opacity .2s ease;transition:opacity .2s ease;z-index:11}.ui.dropdown>.dropdown.icon{width:auto}.ui.dropdown>.text{display:inline-block;-webkit-transition:color .2s ease;-moz-transition:color .2s ease;-o-transition:color .2s ease;-ms-transition:color .2s ease;transition:color .2s ease}.ui.dropdown .menu{left:0}.ui.menu .dropdown:last-child .menu,.ui>.ui.dropdown:last-child .menu{left:auto;right:0}.ui.dropdown .menu .item{cursor:pointer;border:0;border-top:1px solid rgba(0,0,0,.05);font-size:.875em;display:block;color:rgba(0,0,0,.75);padding:.85em 1em!important;font-size:.9rem;text-transform:none;font-weight:400;text-align:left;-webkit-touch-callout:none}.ui.dropdown .menu .item:before{display:none}.ui.dropdown .menu .item .icon{margin-right:.75em}.ui.dropdown .menu .item:first-child{border-top:0}.ui.dropdown.visible{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.dropdown.visible .menu{display:block}.ui.dropdown .menu .item:hover{background-color:rgba(0,0,0,.02);z-index:12}.ui.dropdown .menu .active.item{background-color:rgba(0,0,0,.04);border-left:0;z-index:12}.ui.dropdown>.default.text,.ui.default.dropdown>.text{color:rgba(0,0,0,.5)}.ui.dropdown:hover>.default.text,.ui.default.dropdown:hover>.text{color:rgba(0,0,0,.8)}.ui.simple.dropdown .menu:before,.ui.simple.dropdown .menu:after{display:none}.ui.simple.dropdown .menu{display:block;overflow:hidden;top:-9999px!important;position:absolute;opacity:0;-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;-ms-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.ui.simple.dropdown.visible,.ui.simple.dropdown:hover{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.ui.simple.dropdown.visible .menu,.ui.simple.dropdown:hover .menu{overflow:visible;width:auto;height:auto;top:100%!important;opacity:1}.ui.simple.disabled.dropdown:hover .menu{height:0;width:0;overflow:hidden}.ui.selection.dropdown{cursor:pointer;display:inline-block;background-color:#FFF;padding:.5em 1em;line-height:1.33;color:rgba(0,0,0,.8);-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);-webkit-border-radius:.3125em!important;-moz-border-radius:.3125em!important;border-radius:.3125em!important}.ui.selection.dropdown>.dropdown.icon{float:right;opacity:.7;margin:.2em 0 .2em 1.25em;-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;-ms-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.ui.selection.dropdown,.ui.selection.dropdown .menu{top:100%;-webkit-transition:box-shadow .2s ease-out;-moz-transition:box-shadow .2s ease-out;-o-transition:box-shadow .2s ease-out;-ms-transition:box-shadow .2s ease-out;transition:box-shadow .2s ease-out}.ui.selection.dropdown .menu{max-height:312px;overflow-x:hidden;overflow-y:auto;-webkit-box-shadow:0 1px 0 1px #EEE;-moz-box-shadow:0 1px 0 1px #EEE;box-shadow:0 1px 0 1px #EEE;-moz-border-radius:0 0 .325em .325em;-webkit-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em}.ui.selection.dropdown .menu:after,.ui.selection.dropdown .menu:before{display:none}.ui.selection.dropdown .menu img{height:2.5em;display:inline-block;vertical-align:middle;margin-right:.5em}.ui.selection.dropdown:hover,.ui.selection.dropdown.hover{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.2);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.2);box-shadow:0 0 0 1px rgba(0,0,0,.2)}.ui.selection.dropdown:hover>.dropdown.icon{opacity:1}.ui.selection.dropdown.visible{-webkit-border-radius:.3125em .3125em 0 0!important;-moz-border-radius:.3125em .3125em 0 0!important;border-radius:.3125em .3125em 0 0!important}.ui.selection.dropdown.visible>.dropdown.icon{opacity:1}.ui.selection.dropdown.visible .menu{-webkit-box-shadow:0 1px 0 1px #D3D3D3;-moz-box-shadow:0 1px 0 1px #D3D3D3;box-shadow:0 1px 0 1px #D3D3D3}.ui.fluid.dropdown{display:block}.ui.pointing.dropdown .menu{top:100%;margin-top:.75em;-moz-border-radius:.325em;-webkit-border-radius:.325em;border-radius:.325em}.ui.pointing.dropdown .menu:after{display:block;position:absolute;pointer-events:none;content:" ";visibility:visible;width:.5em;height:.5em;-moz-box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);-webkit-box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);box-shadow:-1px -1px 0 1px rgba(0,0,0,.05);background-image:none;background-color:#FFF;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);z-index:2}.ui.pointing.dropdown .menu .item.active:first-child{background:transparent -webkit-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -moz-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -o-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent -ms-linear-gradient(transparent,rgba(0,0,0,.03));background:transparent linear-gradient(transparent,rgba(0,0,0,.03))}.ui.pointing.dropdown .menu:after{top:-.25em;left:50%;margin:0 0 0 -.25em}.ui.top.left.pointing.dropdown .menu{top:100%;bottom:auto;left:0;right:auto;margin:.75em 0 0}.ui.top.left.pointing.dropdown .menu:after{top:-.25em;left:1em;right:auto;margin:0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}.ui.top.right.pointing.dropdown .menu{top:100%;bottom:auto;right:0;left:auto;margin:.75em 0 0}.ui.top.right.pointing.dropdown .menu:after{top:-.25em;left:auto;right:1em;margin:0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}.ui.left.pointing.dropdown .menu{top:0;left:100%;right:auto;margin:0 0 0 .75em}.ui.left.pointing.dropdown .menu:after{top:1em;left:-.25em;margin:-.1em 0 0 0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);transform:rotate(-45deg)}.ui.right.pointing.dropdown .menu{top:0;left:auto;right:100%;margin:0 .75em 0 0}.ui.right.pointing.dropdown .menu:after{top:1em;left:auto;right:-.25em;margin:-.1em 0 0 0;-webkit-transform:rotate(135deg);-moz-transform:rotate(135deg);transform:rotate(135deg)}.ui.pointing.dropdown.visible,.ui.pointing.dropdown.visible .menu{-moz-border-radius:.325em!important;-webkit-border-radius:.325em!important;border-radius:.325em!important} \ No newline at end of file diff --git a/build/minified/modules/dropdown.min.js b/build/minified/modules/dropdown.min.js index a7b0515c4..6bba8775a 100644 --- a/build/minified/modules/dropdown.min.js +++ b/build/minified/modules/dropdown.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.animation,m=h.selector,n=h.errors,o="."+k,p="module-"+k,q=f.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return f.each(function(){var b,w=a(this),x=a(this).find(m.menu),y=a(this).find(m.item),z=a(this).find(m.text),A=a(this).find(m.input),B="ontouchstart"in c.documentElement,C=this,D=w.data(p);b={initialize:function(){b.debug("Initializing dropdown with bound events",w),B?w.on("touchstart"+o,b.event.test.toggle):"click"==h.on?w.on("click"+o,b.event.test.toggle):"hover"==h.on?w.on("mouseenter"+o,b.delay.show).on("mouseleave"+o,b.delay.hide):w.on(h.on+o,b.toggle),"form"==h.action&&b.set.selected(),y.on(b.get.selectEvent()+o,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),w.data(p,b)},destroy:function(){b.verbose("Destroying previous module for",w),w.off(k).removeData(p)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.intent.test(a,b.toggle),a.stopPropagation()},hide:function(a){b.intent.test(a,b.hide),a.stopPropagation()}},item:{click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e;b.verbose("Adding active state to selected item"),y.removeClass(i.active),d.addClass(i.active),b.action.determine(e,f),a.proxy(h.onChange,w.get())(f,e),c.stopPropagation()}},resetStyle:function(){a(this).removeAttr("style")}},intent:{test:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(x).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")},bind:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)},unbind:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},action:{determine:function(c,d){a.isFunction(b.action[h.action])?(b.verbose("Triggering preset action",h.action),b.action[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(n.action)},none:function(){},hide:function(){b.hide()},changeText:function(a){b.set.text(a),b.hide()},form:function(a,c){b.set.text(a),b.set.value(c),b.hide()}},get:{selectEvent:function(){return B?"touchstart":"click"},text:function(){return z.text()},value:function(){return A.val()},item:function(b){var c;return b=b||A.val(),y.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,z),z.removeClass(i.placeholder),z.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,A),A.val(a)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),y.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},is:{visible:function(){return x.is(":visible")},hidden:function(){return x.is(":not(:visible)")}},can:{click:function(){return B||"click"==h.on},show:function(){return!w.hasClass(i.disabled)}},animate:{show:function(){b.verbose("Doing menu showing animation"),"none"==l.show?x.show():"fade"==l.show?x.hide().clearQueue().fadeIn(150,b.event.resetStyle):"slide"==l.show?x.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},200,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",b.event.resetStyle):b.error(n.animation)},hide:function(){b.verbose("Doing menu hiding animation"),"none"==l.hide?x.hide():"fade"==l.hide?x.show().clearQueue().fadeOut(150,b.event.resetStyle):"slide"==l.hide?x.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",b.event.resetStyle):b.error(n.animation)}},show:function(){b.debug("Checking if dropdown can show"),b.is.visible()||(b.hideOthers(),w.addClass(i.visible),b.animate.show(),b.can.click()&&b.intent.bind(),a.proxy(h.onShow,w.get())())},hide:function(){b.is.hidden()||(b.debug("Hiding dropdown"),w.removeClass(i.visible),b.can.click()&&b.intent.unbind(),b.animate.hide(),a.proxy(h.onHide,w.get())())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.graceTimer),b.graceTimer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.graceTimer),b.graceTimer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(w).has(m.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.moduleName+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.moduleName+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.moduleName+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=r||c,d=c-e,r=c,s.push({Element:C,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.moduleName+":",e=0;r=!1,clearTimeout(b.performance.timer),a.each(s,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",q&&(c+=" '"+q+"'"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(c),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(c,e,f){var g,h;return e=e||v,f=C||f,"string"==typeof c&&D!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(D[e])&&c!=g?D=D[e]:D[e]!==d?h=D[e]:b.error(n.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},u?(D===d&&b.initialize(),e=b.invoke(t)):(D!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={moduleName:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:50,hide:300},animation:{show:"slide",hide:"slide"},onChange:function(){},onShow:function(){},onHide:function(){},errors:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",animation:"The requested animation was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.selector,m=h.errors,n="."+k,o="module-"+k,p=f.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return f.each(function(){var b,v=a(this),w=a(this).find(l.menu),x=a(this).find(l.item),y=a(this).find(l.text),z=a(this).find(l.input),A="ontouchstart"in c.documentElement,B=this,C=v.data(o);b={initialize:function(){b.debug("Initializing dropdown with bound events",v),A?v.on("touchstart"+n,b.event.test.toggle):"click"==h.on?v.on("click"+n,b.event.test.toggle):"hover"==h.on?v.on("mouseenter"+n,b.delay.show).on("mouseleave"+n,b.delay.hide):v.on(h.on+n,b.toggle),"form"==h.action&&b.set.selected(),x.on(b.get.selectEvent()+n,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),v.data(o,b)},destroy:function(){b.verbose("Destroying previous module for",v),v.off(k).removeData(o)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.intent.test(a,b.toggle),a.stopPropagation()},hide:function(a){b.intent.test(a,b.hide),a.stopPropagation()}},item:{click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e;b.verbose("Adding active state to selected item"),x.removeClass(i.active),d.addClass(i.active),b.action.determine(e,f),a.proxy(h.onChange,v.get())(f,e),c.stopPropagation()}},resetStyle:function(){a(this).removeAttr("style")}},intent:{test:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(w).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")},bind:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)},unbind:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},action:{determine:function(c,d){a.isFunction(b.action[h.action])?(b.verbose("Triggering preset action",h.action),b.action[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(m.action)},none:function(){},hide:function(){b.hide()},changeText:function(a){b.set.text(a),b.hide()},form:function(a,c){b.set.text(a),b.set.value(c),b.hide()}},get:{selectEvent:function(){return A?"touchstart":"click"},text:function(){return y.text()},value:function(){return z.val()},item:function(b){var c;return b=b||z.val(),x.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,y),y.removeClass(i.placeholder),y.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,z),z.val(a)},visible:function(){v.addClass(i.visible)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),x.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},remove:{visible:function(){v.removeClass(i.visible)}},is:{visible:function(){return w.is(":visible")},hidden:function(){return w.is(":not(:visible)")}},can:{click:function(){return A||"click"==h.on},show:function(){return!v.hasClass(i.disabled)}},animate:{show:function(c){b.verbose("Doing menu showing animation"),c=c||function(){},"none"==h.animation?c():a.fn.transition!==d?w.transition(h.animation,h.duration,c):"slide down"==h.animation?w.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},h.duration,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.animation?w.hide().clearQueue().fadeIn(h.duration,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.animation)},hide:function(c){b.verbose("Doing menu hiding animation"),c=c||function(){},"none"==h.animation?c():a.fn.transition!==d?w.transition(h.animation,h.duration,c):"slide down"==h.animation?w.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.animation?w.show().clearQueue().fadeOut(150,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.animation)}},show:function(){b.debug("Checking if dropdown can show"),b.is.visible()||(b.hideOthers(),b.animate.show(b.set.visible),b.can.click()&&b.intent.bind(),a.proxy(h.onShow,B)())},hide:function(){b.is.hidden()||(b.debug("Hiding dropdown"),b.can.click()&&b.intent.unbind(),b.animate.hide(b.remove.visible),a.proxy(h.onHide,B)())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.graceTimer),b.graceTimer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.graceTimer),b.graceTimer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(v).has(l.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.moduleName+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.moduleName+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.moduleName+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:B,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.moduleName+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(c,e,f){var g,h;return e=e||u,f=B||f,"string"==typeof c&&C!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(C[e])&&c!=g?C=C[e]:C[e]!==d?h=C[e]:b.error(m.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},t?(C===d&&b.initialize(),e=b.invoke(s)):(C!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={moduleName:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:50,hide:300},animation:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},errors:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",animation:"The requested animation was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/transition.min.css b/build/minified/modules/transition.min.css index 1dc66b9f0..74141fc3e 100644 --- a/build/minified/modules/transition.min.css +++ b/build/minified/modules/transition.min.css @@ -1 +1 @@ -.ui.transition{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden;-webkit-animation-iteration-count:1;-moz-animation-iteration-count:1;-ms-animation-iteration-count:1;-o-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}.ui.hidden.transition{display:none}.ui.visible.transition{display:block}.ui.out.transition{-webkit-animation-direction:reverse;-moz-animation-direction:reverse;-o-animation-direction:reverse;animation-direction:reverse}.ui.disabled.transition{-webkit-animation-play-state:paused;-moz-animation-play-state:paused;-ms-animation-play-state:paused;-o-animation-play-state:paused;animation-play-state:paused}.ui.looping.transition{-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-o-animation-iteration-count:infinite;animation-iteration-count:infinite}.ui.flash.transition{-webkit-animation-name:flash;-moz-animation-name:flash;-o-animation-name:flash;animation-name:flash}.ui.shake.transition{-webkit-animation-name:shake;-moz-animation-name:shake;-o-animation-name:shake;animation-name:shake}.ui.bounce.transition{-webkit-animation-name:bounce;-moz-animation-name:bounce;-o-animation-name:bounce;animation-name:bounce}.ui.tada.transition{-webkit-animation-name:tada;-moz-animation-name:tada;-o-animation-name:tada;animation-name:tada}.ui.pulse.transition{-webkit-animation-name:pulse;-moz-animation-name:pulse;-o-animation-name:pulse;animation-name:pulse}.ui.flip.transition.in,.ui.flip.transition.out{-webkit-perspective:2000px;perspective:2000px}.ui.horizontal.flip.transition.in,.ui.horizontal.flip.transition.out{-webkit-animation-name:horizontalFlip;-moz-animation-name:horizontalFlip;-o-animation-name:horizontalFlip;animation-name:horizontalFlip}.ui.vertical.flip.transition.in,.ui.vertical.flip.transition.out{-webkit-animation-name:verticalFlip;-moz-animation-name:verticalFlip;-o-animation-name:verticalFlip;animation-name:verticalFlip}.ui.fade.transition.in,.ui.fade.transition.out{-webkit-animation-name:fade;-moz-animation-name:fade;-o-animation-name:fade;animation-name:fade}.ui.fade.up.transition.in{-webkit-animation-name:fadeUp;-moz-animation-name:fadeUp;-o-animation-name:fadeUp;animation-name:fadeUp}.ui.fade.up.transition.out{-webkit-animation-name:fadeDown;-moz-animation-name:fadeDown;-o-animation-name:fadeDown;animation-name:fadeDown}.ui.fade.down.transition.in{-webkit-animation-name:fadeDown;-moz-animation-name:fadeDown;-o-animation-name:fadeDown;animation-name:fadeDown}.ui.fade.down.transition.out{-webkit-animation-name:fadeUp;-moz-animation-name:fadeUp;-o-animation-name:fadeUp;animation-name:fadeUp}.ui.scale.transition.in,.ui.scale.transition.out{-webkit-animation-name:scale;-moz-animation-name:scale;-o-animation-name:scale;animation-name:scale}@-moz-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-o-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@-moz-keyframes shake{0%,100%{-moz-transform:translateX(0)}10%,30%,50%,70%,90%{-moz-transform:translateX(-10px)}20%,40%,60%,80%{-moz-transform:translateX(10px)}}@-o-keyframes shake{0%,100%{-o-transform:translateX(0)}10%,30%,50%,70%,90%{-o-transform:translateX(-10px)}20%,40%,60%,80%{-o-transform:translateX(10px)}}@keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}@-webkit-keyframes bounce{0%,20%,50%,80%,100%{-webkit-transform:translateY(0)}40%{-webkit-transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px)}}@-moz-keyframes bounce{0%,20%,50%,80%,100%{-moz-transform:translateY(0)}40%{-moz-transform:translateY(-30px)}60%{-moz-transform:translateY(-15px)}}@-o-keyframes bounce{0%,20%,50%,80%,100%{-o-transform:translateY(0)}40%{-o-transform:translateY(-30px)}60%{-o-transform:translateY(-15px)}}@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0)}}@-moz-keyframes tada{0%{-moz-transform:scale(1)}10%,20%{-moz-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-moz-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-moz-transform:scale(1.1) rotate(-3deg)}100%{-moz-transform:scale(1) rotate(0)}}@-o-keyframes tada{0%{-o-transform:scale(1)}10%,20%{-o-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-o-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-o-transform:scale(1.1) rotate(-3deg)}100%{-o-transform:scale(1) rotate(0)}}@keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.1)}100%{-webkit-transform:scale(1)}}@-moz-keyframes pulse{0%{-moz-transform:scale(1)}50%{-moz-transform:scale(1.1)}100%{-moz-transform:scale(1)}}@-o-keyframes pulse{0%{-o-transform:scale(1)}50%{-o-transform:scale(1.1)}100%{-o-transform:scale(1)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@-webkit-keyframes horizontalFlip{0%{-webkit-transform:rotateX(90deg);opacity:0}100%{-webkit-transform:rotateX(0deg);opacity:1}}@-moz-keyframes horizontalFlip{0%{-moz-transform:rotateX(90deg);opacity:0}100%{-moz-transform:rotateX(0deg);opacity:1}}@-o-keyframes horizontalFlip{0%{-o-transform:rotateX(90deg);opacity:0}100%{-o-transform:rotateX(0deg);opacity:1}}@keyframes horizontalFlip{0%{transform:rotateX(90deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes verticalFlip{0%{-webkit-transform:rotateY(90deg);opacity:0}100%{-webkit-transform:rotateY(0deg);opacity:1}}@-moz-keyframes verticalFlip{0%{-moz-transform:rotateY(90deg);opacity:0}100%{-moz-transform:rotateY(0deg);opacity:1}}@-o-keyframes verticalFlip{0%{-o-transform:rotateY(90deg);opacity:0}100%{-o-transform:rotateY(0deg);opacity:1}}@keyframes verticalFlip{0%{transform:rotateY(90deg);opacity:0}100%{transform:rotateY(0deg);opacity:1}}@-webkit-keyframes fade{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fade{0%{opacity:0}100%{opacity:1}}@-o-keyframes fade{0%{opacity:0}100%{opacity:1}}@keyframes fade{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeDown{0%{opacity:0;-moz-transform:translateY(-20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeDown{0%{opacity:0;-o-transform:translateY(-20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes scale{0%{opacity:0;-webkit-transform:scale(0.7)}100%{opacity:1;-webkit-transform:scale(1)}}@-moz-keyframes scale{0%{opacity:0;-moz-transform:scale(0.7)}100%{opacity:1;-moz-transform:scale(1)}}@-o-keyframes scale{0%{opacity:0;-o-transform:scale(0.7)}100%{opacity:1;-o-transform:scale(1)}}@keyframes scale{0%{opacity:0;transform:scale(0.7)}100%{opacity:1;transform:scale(1)}} \ No newline at end of file +.ui.transition{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden;-webkit-animation-iteration-count:1;-moz-animation-iteration-count:1;-ms-animation-iteration-count:1;-o-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;animation-timing-function:ease;-webkit-animation-timing-function:ease;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0)}.ui.hidden.transition{display:none}.ui.visible.transition{display:block}.ui.out.transition{-webkit-animation-direction:reverse;-moz-animation-direction:reverse;-o-animation-direction:reverse;animation-direction:reverse}.ui.disabled.transition{-webkit-animation-play-state:paused;-moz-animation-play-state:paused;-ms-animation-play-state:paused;-o-animation-play-state:paused;animation-play-state:paused}.ui.looping.transition{-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-o-animation-iteration-count:infinite;animation-iteration-count:infinite}.ui.flash.transition{-webkit-animation-name:flash;-moz-animation-name:flash;-o-animation-name:flash;animation-name:flash}.ui.shake.transition{-webkit-animation-name:shake;-moz-animation-name:shake;-o-animation-name:shake;animation-name:shake}.ui.bounce.transition{-webkit-animation-name:bounce;-moz-animation-name:bounce;-o-animation-name:bounce;animation-name:bounce}.ui.tada.transition{-webkit-animation-name:tada;-moz-animation-name:tada;-o-animation-name:tada;animation-name:tada}.ui.pulse.transition{-webkit-animation-name:pulse;-moz-animation-name:pulse;-o-animation-name:pulse;animation-name:pulse}.ui.flip.transition.in,.ui.flip.transition.out{-webkit-perspective:2000px;perspective:2000px}.ui.horizontal.flip.transition.in,.ui.horizontal.flip.transition.out{-webkit-animation-name:horizontalFlip;-moz-animation-name:horizontalFlip;-o-animation-name:horizontalFlip;animation-name:horizontalFlip}.ui.vertical.flip.transition.in,.ui.vertical.flip.transition.out{-webkit-animation-name:verticalFlip;-moz-animation-name:verticalFlip;-o-animation-name:verticalFlip;animation-name:verticalFlip}.ui.fade.transition.in,.ui.fade.transition.out{-webkit-animation-name:fade;-moz-animation-name:fade;-o-animation-name:fade;animation-name:fade}.ui.fade.up.transition.in{-webkit-animation-name:fadeUp;-moz-animation-name:fadeUp;-o-animation-name:fadeUp;animation-name:fadeUp}.ui.fade.up.transition.out{-webkit-animation-name:fadeDown;-moz-animation-name:fadeDown;-o-animation-name:fadeDown;animation-name:fadeDown}.ui.fade.down.transition.in{-webkit-animation-name:fadeDown;-moz-animation-name:fadeDown;-o-animation-name:fadeDown;animation-name:fadeDown}.ui.fade.down.transition.out{-webkit-animation-name:fadeUp;-moz-animation-name:fadeUp;-o-animation-name:fadeUp;animation-name:fadeUp}.ui.scale.transition.in,.ui.scale.transition.out{-webkit-animation-name:scale;-moz-animation-name:scale;-o-animation-name:scale;animation-name:scale}.ui.slide.down.transition.in,.ui.slide.down.transition.out{-webkit-animation-name:slide;-moz-animation-name:slide;-o-animation-name:slide;animation-name:slide;transform-origin:50% 0;-ms-transform-origin:50% 0;-webkit-transform-origin:50% 0}.ui.slide.up.transition.in,.ui.slide.up.transition.out{-webkit-animation-name:slide;-moz-animation-name:slide;-o-animation-name:slide;animation-name:slide;transform-origin:50% 100%;-ms-transform-origin:50% 100%;-webkit-transform-origin:50% 100%}.ui.slide.up.transition>*,.ui.slide.down.transition>*{-webkit-animation-name:fade;-moz-animation-name:fade;-o-animation-name:fade;animation-name:fade;-webkit-animation-duration:.3s;-moz-animation-duration:.3s;-ms-animation-duration:.3s;-o-animation-duration:.3s;animation-duration:.3s}@-moz-keyframes slide{0%{opacity:0;-moz-transform:scaleY(0)}100%{opacity:1;-moz-transform:scaleY(1)}}@-webkit-keyframes slide{0%{opacity:0;-webkit-transform:scaleY(0)}100%{opacity:1;-webkit-transform:scaleY(1)}}@keyframes slide{0%{opacity:0;transform:scaleY(0)}100%{opacity:1;transform:scaleY(1)}}@-webkit-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-moz-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-o-keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,100%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px)}}@-moz-keyframes shake{0%,100%{-moz-transform:translateX(0)}10%,30%,50%,70%,90%{-moz-transform:translateX(-10px)}20%,40%,60%,80%{-moz-transform:translateX(10px)}}@-o-keyframes shake{0%,100%{-o-transform:translateX(0)}10%,30%,50%,70%,90%{-o-transform:translateX(-10px)}20%,40%,60%,80%{-o-transform:translateX(10px)}}@keyframes shake{0%,100%{transform:translateX(0)}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}@-webkit-keyframes bounce{0%,20%,50%,80%,100%{-webkit-transform:translateY(0)}40%{-webkit-transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px)}}@-moz-keyframes bounce{0%,20%,50%,80%,100%{-moz-transform:translateY(0)}40%{-moz-transform:translateY(-30px)}60%{-moz-transform:translateY(-15px)}}@-o-keyframes bounce{0%,20%,50%,80%,100%{-o-transform:translateY(0)}40%{-o-transform:translateY(-30px)}60%{-o-transform:translateY(-15px)}}@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0)}40%{transform:translateY(-30px)}60%{transform:translateY(-15px)}}@-webkit-keyframes tada{0%{-webkit-transform:scale(1)}10%,20%{-webkit-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1) rotate(-3deg)}100%{-webkit-transform:scale(1) rotate(0)}}@-moz-keyframes tada{0%{-moz-transform:scale(1)}10%,20%{-moz-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-moz-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-moz-transform:scale(1.1) rotate(-3deg)}100%{-moz-transform:scale(1) rotate(0)}}@-o-keyframes tada{0%{-o-transform:scale(1)}10%,20%{-o-transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{-o-transform:scale(1.1) rotate(3deg)}40%,60%,80%{-o-transform:scale(1.1) rotate(-3deg)}100%{-o-transform:scale(1) rotate(0)}}@keyframes tada{0%{transform:scale(1)}10%,20%{transform:scale(0.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}100%{transform:scale(1) rotate(0)}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.1)}100%{-webkit-transform:scale(1)}}@-moz-keyframes pulse{0%{-moz-transform:scale(1)}50%{-moz-transform:scale(1.1)}100%{-moz-transform:scale(1)}}@-o-keyframes pulse{0%{-o-transform:scale(1)}50%{-o-transform:scale(1.1)}100%{-o-transform:scale(1)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@-webkit-keyframes horizontalFlip{0%{-webkit-transform:rotateX(90deg);opacity:0}100%{-webkit-transform:rotateX(0deg);opacity:1}}@-moz-keyframes horizontalFlip{0%{-moz-transform:rotateX(90deg);opacity:0}100%{-moz-transform:rotateX(0deg);opacity:1}}@-o-keyframes horizontalFlip{0%{-o-transform:rotateX(90deg);opacity:0}100%{-o-transform:rotateX(0deg);opacity:1}}@keyframes horizontalFlip{0%{transform:rotateX(90deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes verticalFlip{0%{-webkit-transform:rotateY(90deg);opacity:0}100%{-webkit-transform:rotateY(0deg);opacity:1}}@-moz-keyframes verticalFlip{0%{-moz-transform:rotateY(90deg);opacity:0}100%{-moz-transform:rotateY(0deg);opacity:1}}@-o-keyframes verticalFlip{0%{-o-transform:rotateY(90deg);opacity:0}100%{-o-transform:rotateY(0deg);opacity:1}}@keyframes verticalFlip{0%{transform:rotateY(90deg);opacity:0}100%{transform:rotateY(0deg);opacity:1}}@-webkit-keyframes fade{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fade{0%{opacity:0}100%{opacity:1}}@-o-keyframes fade{0%{opacity:0}100%{opacity:1}}@keyframes fade{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes fadeDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeDown{0%{opacity:0;-moz-transform:translateY(-20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeDown{0%{opacity:0;-o-transform:translateY(-20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}@-webkit-keyframes scale{0%{opacity:0;-webkit-transform:scale(0.7)}100%{opacity:1;-webkit-transform:scale(1)}}@-moz-keyframes scale{0%{opacity:0;-moz-transform:scale(0.7)}100%{opacity:1;-moz-transform:scale(1)}}@-o-keyframes scale{0%{opacity:0;-o-transform:scale(0.7)}100%{opacity:1;-o-transform:scale(1)}}@keyframes scale{0%{opacity:0;transform:scale(0.7)}100%{opacity:1;transform:scale(1)}} \ No newline at end of file diff --git a/build/packaged/modules/dropdown.js b/build/packaged/modules/dropdown.js index ddcbe2ab1..67cfe0e26 100644 --- a/build/packaged/modules/dropdown.js +++ b/build/packaged/modules/dropdown.js @@ -21,7 +21,6 @@ $.fn.dropdown = function(parameters) { className = settings.className, metadata = settings.metadata, namespace = settings.namespace, - animation = settings.animation, selector = settings.selector, errors = settings.errors, @@ -252,6 +251,9 @@ $.fn.dropdown = function(parameters) { module.debug('Adding selected value to hidden input', value, $input); $input.val(value); }, + visible: function() { + $module.addClass(className.visible); + }, selected: function(value) { var $selectedItem = module.get.item(value), @@ -271,6 +273,12 @@ $.fn.dropdown = function(parameters) { } }, + remove: { + visible: function() { + $module.removeClass(className.visible); + } + }, + is: { visible: function() { return $menu.is(':visible'); @@ -290,21 +298,17 @@ $.fn.dropdown = function(parameters) { }, animate: { - show: function() { + show: function(callback) { module.verbose('Doing menu showing animation'); - if(animation.show == 'none') { - $menu - .show() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.show == 'fade') { - $menu - .hide() - .clearQueue() - .fadeIn(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.show == 'slide') { + else if(settings.animation == 'slide down') { $menu .hide() .clearQueue() @@ -314,30 +318,39 @@ $.fn.dropdown = function(parameters) { .delay(50) .animate({ opacity : 1 - }, 200, 'easeOutQuad', module.event.resetStyle) + }, settings.duration, 'easeOutQuad', module.event.resetStyle) .end() - .slideDown(100, 'easeOutQuad', module.event.resetStyle) + .slideDown(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .hide() + .clearQueue() + .fadeIn(settings.duration, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { module.error(errors.animation); } }, - hide: function() { + hide: function(callback) { module.verbose('Doing menu hiding animation'); - if(animation.hide == 'none') { - $menu - .hide() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.hide == 'fade') { - $menu - .show() - .clearQueue() - .fadeOut(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.hide == 'slide') { + else if(settings.animation == 'slide down') { $menu .show() .clearQueue() @@ -349,7 +362,20 @@ $.fn.dropdown = function(parameters) { }, 100, 'easeOutQuad', module.event.resetStyle) .end() .delay(50) - .slideUp(100, 'easeOutQuad', module.event.resetStyle) + .slideUp(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .show() + .clearQueue() + .fadeOut(150, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { @@ -362,28 +388,22 @@ $.fn.dropdown = function(parameters) { module.debug('Checking if dropdown can show'); if( !module.is.visible() ) { module.hideOthers(); - $module - .addClass(className.visible) - ; - module.animate.show(); + module.animate.show(module.set.visible); if( module.can.click() ) { module.intent.bind(); } - $.proxy(settings.onShow, $module.get() )(); + $.proxy(settings.onShow, element)(); } }, hide: function() { if( !module.is.hidden() ) { module.debug('Hiding dropdown'); - $module - .removeClass(className.visible) - ; if( module.can.click() ) { module.intent.unbind(); } - module.animate.hide(); - $.proxy(settings.onHide, $module.get() )(); + module.animate.hide(module.remove.visible); + $.proxy(settings.onHide, element)(); } }, @@ -589,10 +609,8 @@ $.fn.dropdown.settings = { hide: 300 }, - animation : { - show: 'slide', - hide: 'slide' - }, + animation : 'slide down', + duration : 250, onChange : function(){}, onShow : function(){}, diff --git a/build/packaged/semantic.min.css.REMOVED.git-id b/build/packaged/semantic.min.css.REMOVED.git-id index 489fdd17a..103a39eb5 100644 --- a/build/packaged/semantic.min.css.REMOVED.git-id +++ b/build/packaged/semantic.min.css.REMOVED.git-id @@ -1 +1 @@ -027a7ceb5a7590587a6c011811afd0713d347388 \ No newline at end of file +4f902d6bc98aeb0197bda649f237cb033d29a2d8 \ No newline at end of file diff --git a/build/packaged/semantic.min.js.REMOVED.git-id b/build/packaged/semantic.min.js.REMOVED.git-id index b3246a099..c933a6ddd 100644 --- a/build/packaged/semantic.min.js.REMOVED.git-id +++ b/build/packaged/semantic.min.js.REMOVED.git-id @@ -1 +1 @@ -52af607b392c792fb7ba0c89a9a5147cc4edaebb \ No newline at end of file +dbb6a82a4129bd88e6ca5996e9eb2d8e2cbb4f0d \ No newline at end of file diff --git a/build/uncompressed/modules/dropdown.css b/build/uncompressed/modules/dropdown.css index cadf47cb5..103ccb6f7 100644 --- a/build/uncompressed/modules/dropdown.css +++ b/build/uncompressed/modules/dropdown.css @@ -22,13 +22,15 @@ -ms-transition: border-radius 0.1s ease, width 0.2s ease; transition: border-radius 0.1s ease, width 0.2s ease; } -.ui.dropdown .menu { +.ui.dropdown > .menu { position: absolute; display: none; top: 100%; + margin: 0em; background-color: #FFFFFF; min-width: 100%; white-space: nowrap; + font-size: 0.875em; text-shadow: none; -webkit-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1), 0px -2px 0px 0px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1), 0px -2px 0px 0px rgba(0, 0, 0, 0.1) inset; @@ -203,6 +205,10 @@ -webkit-border-radius: 0px 0px 0.325em 0.325em; border-radius: 0px 0px 0.325em 0.325em; } +.ui.selection.dropdown .menu:after, +.ui.selection.dropdown .menu:before { + display: none; +} .ui.selection.dropdown .menu img { height: 2.5em; display: inline-block; @@ -250,9 +256,11 @@ border-radius: 0.325em; } .ui.pointing.dropdown .menu:after { + display: block; position: absolute; pointer-events: none; content: " "; + visibility: visible; width: 0.5em; height: 0.5em; -moz-box-shadow: -1px -1px 0px 1px rgba(0, 0, 0, 0.05); diff --git a/build/uncompressed/modules/dropdown.js b/build/uncompressed/modules/dropdown.js index ddcbe2ab1..67cfe0e26 100644 --- a/build/uncompressed/modules/dropdown.js +++ b/build/uncompressed/modules/dropdown.js @@ -21,7 +21,6 @@ $.fn.dropdown = function(parameters) { className = settings.className, metadata = settings.metadata, namespace = settings.namespace, - animation = settings.animation, selector = settings.selector, errors = settings.errors, @@ -252,6 +251,9 @@ $.fn.dropdown = function(parameters) { module.debug('Adding selected value to hidden input', value, $input); $input.val(value); }, + visible: function() { + $module.addClass(className.visible); + }, selected: function(value) { var $selectedItem = module.get.item(value), @@ -271,6 +273,12 @@ $.fn.dropdown = function(parameters) { } }, + remove: { + visible: function() { + $module.removeClass(className.visible); + } + }, + is: { visible: function() { return $menu.is(':visible'); @@ -290,21 +298,17 @@ $.fn.dropdown = function(parameters) { }, animate: { - show: function() { + show: function(callback) { module.verbose('Doing menu showing animation'); - if(animation.show == 'none') { - $menu - .show() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.show == 'fade') { - $menu - .hide() - .clearQueue() - .fadeIn(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.show == 'slide') { + else if(settings.animation == 'slide down') { $menu .hide() .clearQueue() @@ -314,30 +318,39 @@ $.fn.dropdown = function(parameters) { .delay(50) .animate({ opacity : 1 - }, 200, 'easeOutQuad', module.event.resetStyle) + }, settings.duration, 'easeOutQuad', module.event.resetStyle) .end() - .slideDown(100, 'easeOutQuad', module.event.resetStyle) + .slideDown(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .hide() + .clearQueue() + .fadeIn(settings.duration, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { module.error(errors.animation); } }, - hide: function() { + hide: function(callback) { module.verbose('Doing menu hiding animation'); - if(animation.hide == 'none') { - $menu - .hide() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.hide == 'fade') { - $menu - .show() - .clearQueue() - .fadeOut(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.hide == 'slide') { + else if(settings.animation == 'slide down') { $menu .show() .clearQueue() @@ -349,7 +362,20 @@ $.fn.dropdown = function(parameters) { }, 100, 'easeOutQuad', module.event.resetStyle) .end() .delay(50) - .slideUp(100, 'easeOutQuad', module.event.resetStyle) + .slideUp(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .show() + .clearQueue() + .fadeOut(150, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { @@ -362,28 +388,22 @@ $.fn.dropdown = function(parameters) { module.debug('Checking if dropdown can show'); if( !module.is.visible() ) { module.hideOthers(); - $module - .addClass(className.visible) - ; - module.animate.show(); + module.animate.show(module.set.visible); if( module.can.click() ) { module.intent.bind(); } - $.proxy(settings.onShow, $module.get() )(); + $.proxy(settings.onShow, element)(); } }, hide: function() { if( !module.is.hidden() ) { module.debug('Hiding dropdown'); - $module - .removeClass(className.visible) - ; if( module.can.click() ) { module.intent.unbind(); } - module.animate.hide(); - $.proxy(settings.onHide, $module.get() )(); + module.animate.hide(module.remove.visible); + $.proxy(settings.onHide, element)(); } }, @@ -589,10 +609,8 @@ $.fn.dropdown.settings = { hide: 300 }, - animation : { - show: 'slide', - hide: 'slide' - }, + animation : 'slide down', + duration : 250, onChange : function(){}, onShow : function(){}, diff --git a/build/uncompressed/modules/transition.css b/build/uncompressed/modules/transition.css index ab17f79b4..e730befc9 100644 --- a/build/uncompressed/modules/transition.css +++ b/build/uncompressed/modules/transition.css @@ -27,11 +27,18 @@ -ms-animation-duration: 1s; -o-animation-duration: 1s; animation-duration: 1s; + animation-timing-function: ease; + -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-fill-mode: both; -ms-animation-fill-mode: both; -o-animation-fill-mode: both; animation-fill-mode: both; + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + -o-transform: translateZ(0); + transform: translateZ(0); } /******************************* States @@ -172,6 +179,71 @@ -o-animation-name: scale; animation-name: scale; } +/*-------------- + Slide +---------------*/ +.ui.slide.down.transition.in, +.ui.slide.down.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; +} +.ui.slide.up.transition.in, +.ui.slide.up.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + -webkit-transform-origin: 50% 100%; +} +.ui.slide.up.transition > *, +.ui.slide.down.transition > * { + -webkit-animation-name: fade; + -moz-animation-name: fade; + -o-animation-name: fade; + animation-name: fade; + -webkit-animation-duration: 0.3s; + -moz-animation-duration: 0.3s; + -ms-animation-duration: 0.3s; + -o-animation-duration: 0.3s; + animation-duration: 0.3s; +} +@-moz-keyframes slide { + 0% { + opacity: 0; + -moz-transform: scaleY(0); + } + 100% { + opacity: 1; + -moz-transform: scaleY(1); + } +} +@-webkit-keyframes slide { + 0% { + opacity: 0; + -webkit-transform: scaleY(0); + } + 100% { + opacity: 1; + -webkit-transform: scaleY(1); + } +} +@keyframes slide { + 0% { + opacity: 0; + transform: scaleY(0); + } + 100% { + opacity: 1; + transform: scaleY(1); + } +} /******************************* Animations *******************************/ @@ -179,6 +251,17 @@ Emphasis ---------------*/ /* Flash */ +@-webkit-keyframes flash { + 0%, + 50%, + 100% { + opacity: 1; + } + 25%, + 75% { + opacity: 0; + } +} @-moz-keyframes flash { 0%, 50%, diff --git a/node/src/documents/modules/transition.html b/node/src/documents/modules/transition.html index 04901f41b..e5c9f7615 100755 --- a/node/src/documents/modules/transition.html +++ b/node/src/documents/modules/transition.html @@ -53,6 +53,14 @@ type : 'UI Module' ; +

Static Animations

+

Animations that do not have an in or out animation defined, will maintain their current visibility after running

+
+ $('.dog.image') + .transition('pulse') + ; +
+

Transition Direction

If an animation direction is not specified it will automatically be determined based on the elements current visibility. For example, if the element is visible the animation "fade out" will be called, if the animation is not visible "fade in".

@@ -88,19 +96,6 @@ type : 'UI Module' ; -

Looping

-
- $('.dog.image') - .transition('set looping') - .transition('pulse') - ; -
-
- $('.dog.image') - .transition('remove looping') - ; -
-

Types

Emphasis

@@ -173,6 +168,16 @@ type : 'UI Module' +
+

Slide

+
+ $('.dog.image') + .transition('slide up') + .transition('slide down') + ; +
+
+

Behavior

Settings

diff --git a/node/src/files/components/semantic/modules/dropdown.css b/node/src/files/components/semantic/modules/dropdown.css index cadf47cb5..103ccb6f7 100644 --- a/node/src/files/components/semantic/modules/dropdown.css +++ b/node/src/files/components/semantic/modules/dropdown.css @@ -22,13 +22,15 @@ -ms-transition: border-radius 0.1s ease, width 0.2s ease; transition: border-radius 0.1s ease, width 0.2s ease; } -.ui.dropdown .menu { +.ui.dropdown > .menu { position: absolute; display: none; top: 100%; + margin: 0em; background-color: #FFFFFF; min-width: 100%; white-space: nowrap; + font-size: 0.875em; text-shadow: none; -webkit-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1), 0px -2px 0px 0px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1), 0px -2px 0px 0px rgba(0, 0, 0, 0.1) inset; @@ -203,6 +205,10 @@ -webkit-border-radius: 0px 0px 0.325em 0.325em; border-radius: 0px 0px 0.325em 0.325em; } +.ui.selection.dropdown .menu:after, +.ui.selection.dropdown .menu:before { + display: none; +} .ui.selection.dropdown .menu img { height: 2.5em; display: inline-block; @@ -250,9 +256,11 @@ border-radius: 0.325em; } .ui.pointing.dropdown .menu:after { + display: block; position: absolute; pointer-events: none; content: " "; + visibility: visible; width: 0.5em; height: 0.5em; -moz-box-shadow: -1px -1px 0px 1px rgba(0, 0, 0, 0.05); diff --git a/node/src/files/components/semantic/modules/dropdown.js b/node/src/files/components/semantic/modules/dropdown.js index ddcbe2ab1..67cfe0e26 100644 --- a/node/src/files/components/semantic/modules/dropdown.js +++ b/node/src/files/components/semantic/modules/dropdown.js @@ -21,7 +21,6 @@ $.fn.dropdown = function(parameters) { className = settings.className, metadata = settings.metadata, namespace = settings.namespace, - animation = settings.animation, selector = settings.selector, errors = settings.errors, @@ -252,6 +251,9 @@ $.fn.dropdown = function(parameters) { module.debug('Adding selected value to hidden input', value, $input); $input.val(value); }, + visible: function() { + $module.addClass(className.visible); + }, selected: function(value) { var $selectedItem = module.get.item(value), @@ -271,6 +273,12 @@ $.fn.dropdown = function(parameters) { } }, + remove: { + visible: function() { + $module.removeClass(className.visible); + } + }, + is: { visible: function() { return $menu.is(':visible'); @@ -290,21 +298,17 @@ $.fn.dropdown = function(parameters) { }, animate: { - show: function() { + show: function(callback) { module.verbose('Doing menu showing animation'); - if(animation.show == 'none') { - $menu - .show() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.show == 'fade') { - $menu - .hide() - .clearQueue() - .fadeIn(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.show == 'slide') { + else if(settings.animation == 'slide down') { $menu .hide() .clearQueue() @@ -314,30 +318,39 @@ $.fn.dropdown = function(parameters) { .delay(50) .animate({ opacity : 1 - }, 200, 'easeOutQuad', module.event.resetStyle) + }, settings.duration, 'easeOutQuad', module.event.resetStyle) .end() - .slideDown(100, 'easeOutQuad', module.event.resetStyle) + .slideDown(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .hide() + .clearQueue() + .fadeIn(settings.duration, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { module.error(errors.animation); } }, - hide: function() { + hide: function(callback) { module.verbose('Doing menu hiding animation'); - if(animation.hide == 'none') { - $menu - .hide() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.hide == 'fade') { - $menu - .show() - .clearQueue() - .fadeOut(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.hide == 'slide') { + else if(settings.animation == 'slide down') { $menu .show() .clearQueue() @@ -349,7 +362,20 @@ $.fn.dropdown = function(parameters) { }, 100, 'easeOutQuad', module.event.resetStyle) .end() .delay(50) - .slideUp(100, 'easeOutQuad', module.event.resetStyle) + .slideUp(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .show() + .clearQueue() + .fadeOut(150, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { @@ -362,28 +388,22 @@ $.fn.dropdown = function(parameters) { module.debug('Checking if dropdown can show'); if( !module.is.visible() ) { module.hideOthers(); - $module - .addClass(className.visible) - ; - module.animate.show(); + module.animate.show(module.set.visible); if( module.can.click() ) { module.intent.bind(); } - $.proxy(settings.onShow, $module.get() )(); + $.proxy(settings.onShow, element)(); } }, hide: function() { if( !module.is.hidden() ) { module.debug('Hiding dropdown'); - $module - .removeClass(className.visible) - ; if( module.can.click() ) { module.intent.unbind(); } - module.animate.hide(); - $.proxy(settings.onHide, $module.get() )(); + module.animate.hide(module.remove.visible); + $.proxy(settings.onHide, element)(); } }, @@ -589,10 +609,8 @@ $.fn.dropdown.settings = { hide: 300 }, - animation : { - show: 'slide', - hide: 'slide' - }, + animation : 'slide down', + duration : 250, onChange : function(){}, onShow : function(){}, diff --git a/node/src/files/components/semantic/modules/transition.css b/node/src/files/components/semantic/modules/transition.css index ab17f79b4..e730befc9 100644 --- a/node/src/files/components/semantic/modules/transition.css +++ b/node/src/files/components/semantic/modules/transition.css @@ -27,11 +27,18 @@ -ms-animation-duration: 1s; -o-animation-duration: 1s; animation-duration: 1s; + animation-timing-function: ease; + -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-fill-mode: both; -ms-animation-fill-mode: both; -o-animation-fill-mode: both; animation-fill-mode: both; + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + -o-transform: translateZ(0); + transform: translateZ(0); } /******************************* States @@ -172,6 +179,71 @@ -o-animation-name: scale; animation-name: scale; } +/*-------------- + Slide +---------------*/ +.ui.slide.down.transition.in, +.ui.slide.down.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; +} +.ui.slide.up.transition.in, +.ui.slide.up.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + -webkit-transform-origin: 50% 100%; +} +.ui.slide.up.transition > *, +.ui.slide.down.transition > * { + -webkit-animation-name: fade; + -moz-animation-name: fade; + -o-animation-name: fade; + animation-name: fade; + -webkit-animation-duration: 0.3s; + -moz-animation-duration: 0.3s; + -ms-animation-duration: 0.3s; + -o-animation-duration: 0.3s; + animation-duration: 0.3s; +} +@-moz-keyframes slide { + 0% { + opacity: 0; + -moz-transform: scaleY(0); + } + 100% { + opacity: 1; + -moz-transform: scaleY(1); + } +} +@-webkit-keyframes slide { + 0% { + opacity: 0; + -webkit-transform: scaleY(0); + } + 100% { + opacity: 1; + -webkit-transform: scaleY(1); + } +} +@keyframes slide { + 0% { + opacity: 0; + transform: scaleY(0); + } + 100% { + opacity: 1; + transform: scaleY(1); + } +} /******************************* Animations *******************************/ @@ -179,6 +251,17 @@ Emphasis ---------------*/ /* Flash */ +@-webkit-keyframes flash { + 0%, + 50%, + 100% { + opacity: 1; + } + 25%, + 75% { + opacity: 0; + } +} @-moz-keyframes flash { 0%, 50%, diff --git a/src/modules/dropdown.js b/src/modules/dropdown.js index ddcbe2ab1..67cfe0e26 100755 --- a/src/modules/dropdown.js +++ b/src/modules/dropdown.js @@ -21,7 +21,6 @@ $.fn.dropdown = function(parameters) { className = settings.className, metadata = settings.metadata, namespace = settings.namespace, - animation = settings.animation, selector = settings.selector, errors = settings.errors, @@ -252,6 +251,9 @@ $.fn.dropdown = function(parameters) { module.debug('Adding selected value to hidden input', value, $input); $input.val(value); }, + visible: function() { + $module.addClass(className.visible); + }, selected: function(value) { var $selectedItem = module.get.item(value), @@ -271,6 +273,12 @@ $.fn.dropdown = function(parameters) { } }, + remove: { + visible: function() { + $module.removeClass(className.visible); + } + }, + is: { visible: function() { return $menu.is(':visible'); @@ -290,21 +298,17 @@ $.fn.dropdown = function(parameters) { }, animate: { - show: function() { + show: function(callback) { module.verbose('Doing menu showing animation'); - if(animation.show == 'none') { - $menu - .show() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.show == 'fade') { - $menu - .hide() - .clearQueue() - .fadeIn(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.show == 'slide') { + else if(settings.animation == 'slide down') { $menu .hide() .clearQueue() @@ -314,30 +318,39 @@ $.fn.dropdown = function(parameters) { .delay(50) .animate({ opacity : 1 - }, 200, 'easeOutQuad', module.event.resetStyle) + }, settings.duration, 'easeOutQuad', module.event.resetStyle) .end() - .slideDown(100, 'easeOutQuad', module.event.resetStyle) + .slideDown(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .hide() + .clearQueue() + .fadeIn(settings.duration, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { module.error(errors.animation); } }, - hide: function() { + hide: function(callback) { module.verbose('Doing menu hiding animation'); - if(animation.hide == 'none') { - $menu - .hide() - ; + callback = callback || function(){}; + + if(settings.animation == 'none') { + callback(); } - else if(animation.hide == 'fade') { - $menu - .show() - .clearQueue() - .fadeOut(150, module.event.resetStyle) - ; + else if($.fn.transition !== undefined) { + $menu.transition(settings.animation, settings.duration, callback); } - else if(animation.hide == 'slide') { + else if(settings.animation == 'slide down') { $menu .show() .clearQueue() @@ -349,7 +362,20 @@ $.fn.dropdown = function(parameters) { }, 100, 'easeOutQuad', module.event.resetStyle) .end() .delay(50) - .slideUp(100, 'easeOutQuad', module.event.resetStyle) + .slideUp(100, 'easeOutQuad', function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) + ; + } + else if(settings.animation == 'fade') { + $menu + .show() + .clearQueue() + .fadeOut(150, function() { + $.proxy(module.event.resetStyle, this)(); + callback(); + }) ; } else { @@ -362,28 +388,22 @@ $.fn.dropdown = function(parameters) { module.debug('Checking if dropdown can show'); if( !module.is.visible() ) { module.hideOthers(); - $module - .addClass(className.visible) - ; - module.animate.show(); + module.animate.show(module.set.visible); if( module.can.click() ) { module.intent.bind(); } - $.proxy(settings.onShow, $module.get() )(); + $.proxy(settings.onShow, element)(); } }, hide: function() { if( !module.is.hidden() ) { module.debug('Hiding dropdown'); - $module - .removeClass(className.visible) - ; if( module.can.click() ) { module.intent.unbind(); } - module.animate.hide(); - $.proxy(settings.onHide, $module.get() )(); + module.animate.hide(module.remove.visible); + $.proxy(settings.onHide, element)(); } }, @@ -589,10 +609,8 @@ $.fn.dropdown.settings = { hide: 300 }, - animation : { - show: 'slide', - hide: 'slide' - }, + animation : 'slide down', + duration : 250, onChange : function(){}, onShow : function(){}, diff --git a/src/modules/dropdown.less b/src/modules/dropdown.less index 334aa50ae..875419005 100755 --- a/src/modules/dropdown.less +++ b/src/modules/dropdown.less @@ -43,14 +43,17 @@ ; } -.ui.dropdown .menu { +.ui.dropdown > .menu { position: absolute; display: none; top: 100%; + + margin: 0em; background-color: #FFFFFF; min-width: 100%; - white-space: nowrap; + white-space: nowrap; + font-size: 0.875em; text-shadow: none; -webkit-box-shadow: @@ -270,6 +273,10 @@ -webkit-border-radius: 0px 0px 0.325em 0.325em; border-radius: 0px 0px 0.325em 0.325em; } +.ui.selection.dropdown .menu:after, +.ui.selection.dropdown .menu:before { + display: none; +} .ui.selection.dropdown .menu img { height: 2.5em; display: inline-block; @@ -325,10 +332,11 @@ } .ui.pointing.dropdown .menu:after { + display: block; position: absolute; pointer-events: none; content: " "; - + visibility: visible; width: 0.5em; height: 0.5em; diff --git a/src/modules/transition.less b/src/modules/transition.less index a620a868f..ee3ad5df9 100755 --- a/src/modules/transition.less +++ b/src/modules/transition.less @@ -32,11 +32,20 @@ -o-animation-duration: 1s; animation-duration: 1s; + animation-timing-function: ease; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: both; -moz-animation-fill-mode: both; -ms-animation-fill-mode: both; -o-animation-fill-mode: both; animation-fill-mode: both; + + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + -o-transform: translateZ(0); + transform: translateZ(0); } /******************************* @@ -197,6 +206,76 @@ } +/*-------------- + Slide +---------------*/ + +.ui.slide.down.transition.in, +.ui.slide.down.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; +} +.ui.slide.up.transition.in, +.ui.slide.up.transition.out { + -webkit-animation-name: slide; + -moz-animation-name: slide; + -o-animation-name: slide; + animation-name: slide; + transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + -webkit-transform-origin: 50% 100%; +} + +.ui.slide.up.transition > *, +.ui.slide.down.transition > * { + -webkit-animation-name: fade; + -moz-animation-name: fade; + -o-animation-name: fade; + animation-name: fade; + -webkit-animation-duration: 0.3s; + -moz-animation-duration: 0.3s; + -ms-animation-duration: 0.3s; + -o-animation-duration: 0.3s; + animation-duration: 0.3s; +} + +@-moz-keyframes slide { + 0% { + opacity: 0; + -moz-transform: scaleY(0); + } + 100% { + opacity: 1; + -moz-transform: scaleY(1); + } +} +@-webkit-keyframes slide { + 0% { + opacity: 0; + -webkit-transform: scaleY(0); + } + 100% { + opacity: 1; + -webkit-transform: scaleY(1); + } +} +@keyframes slide { + 0% { + opacity: 0; + transform: scaleY(0); + } + 100% { + opacity: 1; + transform: scaleY(1); + } +} + + /******************************* Animations *******************************/ @@ -206,6 +285,14 @@ ---------------*/ /* Flash */ +@-webkit-keyframes flash { + 0%, 50%, 100% { + opacity: 1; + } + 25%, 75% { + opacity: 0; + } +} @-moz-keyframes flash { 0%, 50%, 100% { opacity: 1; @@ -395,46 +482,46 @@ @-webkit-keyframes pulse { 0% { - -webkit-transform: scale(1); + -webkit-transform: scale(1); } 50% { - -webkit-transform: scale(1.1); + -webkit-transform: scale(1.1); } 100% { - -webkit-transform: scale(1); + -webkit-transform: scale(1); } } @-moz-keyframes pulse { 0% { - -moz-transform: scale(1); + -moz-transform: scale(1); } 50% { - -moz-transform: scale(1.1); + -moz-transform: scale(1.1); } 100% { - -moz-transform: scale(1); + -moz-transform: scale(1); } } @-o-keyframes pulse { 0% { - -o-transform: scale(1); + -o-transform: scale(1); } 50% { - -o-transform: scale(1.1); + -o-transform: scale(1.1); } 100% { - -o-transform: scale(1); + -o-transform: scale(1); } } @keyframes pulse { 0% { - transform: scale(1); + transform: scale(1); } 50% { - transform: scale(1.1); + transform: scale(1.1); } 100% { - transform: scale(1); + transform: scale(1); } }