Browse Source

Add failsafe for dimmer

pull/1785/head
jlukic 9 years ago
parent
commit
296463bfb8
1 changed files with 11 additions and 9 deletions
  1. 20
      src/definitions/modules/dimmer.js

20
src/definitions/modules/dimmer.js

@ -215,13 +215,14 @@ $.fn.dimmer = function(parameters) {
if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) { if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
$dimmer $dimmer
.transition({ .transition({
animation : settings.transition + ' in',
animation : settings.transition + ' in',
queue : false, queue : false,
duration : module.get.duration(),
onStart : function() {
duration : module.get.duration(),
useFailSafe : true,
onStart : function() {
module.set.dimmed(); module.set.dimmed();
}, },
onComplete : function() {
onComplete : function() {
module.set.active(); module.set.active();
callback(); callback();
} }
@ -255,13 +256,14 @@ $.fn.dimmer = function(parameters) {
module.verbose('Hiding dimmer with css'); module.verbose('Hiding dimmer with css');
$dimmer $dimmer
.transition({ .transition({
animation : settings.transition + ' out',
queue : false,
duration : module.get.duration(),
onStart : function() {
animation : settings.transition + ' out',
queue : false,
duration : module.get.duration(),
useFailSafe : true,
onStart : function() {
module.remove.dimmed(); module.remove.dimmed();
}, },
onComplete : function() {
onComplete : function() {
module.remove.active(); module.remove.active();
callback(); callback();
} }

Loading…
Cancel
Save