Browse Source

Fixes #23 issue with queued animations in dropdown and modal

Former-commit-id: 303498459f
Former-commit-id: e93adbf1f3
pull/258/head
jlukic 11 years ago
parent
commit
8f6074fae8
3 changed files with 11 additions and 12 deletions
  1. 2
      node/src/documents/modules/dimmer.html
  2. 9
      src/modules/dimmer.js
  3. 12
      src/modules/dropdown.js

2
node/src/documents/modules/dimmer.html

@ -19,7 +19,7 @@ type : 'UI Module'
</div>
</div>
<div class="segment">
<div class="ui vertical segment">
<div class="container">
<h1 class="ui dividing header">
Dimmer

9
src/modules/dimmer.js

@ -191,7 +191,7 @@ $.fn.dimmer = function(parameters) {
return $dimmer.hasClass(className.active);
},
animating: function() {
return ( $dimmer.hasClass(className.show) || $dimmer.hasClass(className.hide) || $dimmer.is(':animated') );
return ( $dimmer.is(':animated') || $dimmer.hasClass(className.transition) );
},
dimmer: function() {
return $module.is(selector.dimmer);
@ -259,7 +259,7 @@ $.fn.dimmer = function(parameters) {
show: function(callback) {
module.debug('Showing dimmer', $dimmer);
if( (!module.is.active() || module.is.animating() ) && module.is.enabled() ) {
if( !(module.is.active() || module.is.animating() ) && module.is.enabled() ) {
module.animate.show(callback);
$.proxy(settings.onShow, element)();
$.proxy(settings.onChange, element)();
@ -270,7 +270,7 @@ $.fn.dimmer = function(parameters) {
},
hide: function(callback) {
if( module.is.active() || module.is.animating() ) {
if( module.is.active() && !module.is.animating() ) {
module.debug('Hiding dimmer', $dimmer);
module.animate.hide(callback);
$.proxy(settings.onHide, element)();
@ -510,14 +510,13 @@ $.fn.dimmer.settings = {
className : {
active : 'active',
animating : 'animating',
dimmable : 'ui dimmable',
dimmed : 'dimmed',
disabled : 'disabled',
pageDimmer : 'page',
hide : 'hide',
show : 'show',
transition : 'transition hidden visible'
transition : 'transition'
}
};

12
src/modules/dropdown.js

@ -316,14 +316,14 @@ $.fn.dropdown = function(parameters) {
is: {
visible: function($subMenu) {
return ($subMenu)
? $subMenu.is(':visible')
: $menu.is(':visible')
? $subMenu.is(':animated, :visible')
: $menu.is(':animated, :visible')
;
},
hidden: function($subMenu) {
return ($subMenu)
? $subMenu.is(':not(:visible)')
: $menu.is(':not(:visible)')
? $subMenu.is(':not(:animated, :visible)')
: $menu.is(':not(:animated, :visible)')
;
}
},
@ -434,7 +434,7 @@ $.fn.dropdown = function(parameters) {
show: function() {
dropdown.debug('Checking if dropdown can show');
if( !dropdown.is.visible() ) {
if( dropdown.is.hidden() ) {
dropdown.hideOthers();
dropdown.set.active();
dropdown.animate.show(dropdown.set.visible);
@ -446,7 +446,7 @@ $.fn.dropdown = function(parameters) {
},
hide: function() {
if( !dropdown.is.hidden() ) {
if( dropdown.is.visible() ) {
dropdown.debug('Hiding dropdown');
if( dropdown.can.click() ) {
dropdown.unbind.intent();

Loading…
Cancel
Save