Skip to content

Commit 68bf29f

Browse files
authored
feat(dimmer): support individual show/hide duration
This PR adds the same syntax for the optional hideDuration/showDuration value of the transition setting to the dimmer module as we already have in toast, modal, popup and dropdown. As dimmer was the only module which was already/also supporting an object for the duration value, i kept the logic in for backward compatibility
1 parent 09d5711 commit 68bf29f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/definitions/modules/dimmer.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,12 @@ $.fn.dimmer = function(parameters) {
335335
return $dimmer;
336336
},
337337
duration: function() {
338-
if(typeof settings.duration == 'object') {
339-
if( module.is.active() ) {
340-
return settings.duration.hide;
341-
}
342-
else {
343-
return settings.duration.show;
344-
}
338+
if( module.is.active() ) {
339+
return settings.transition.hideDuration || settings.duration.hide || settings.duration;
340+
}
341+
else {
342+
return settings.transition.showDuration || settings.duration.show || settings.duration;
345343
}
346-
return settings.duration;
347344
}
348345
},
349346

0 commit comments

Comments
 (0)