Skip to content

Commit 8ae681c

Browse files
authored
feat(dropdown): support separate transition displaytype
In situations where a dropdown was inside a right menu (which got a flex setting) the transition module was taking that flex displaytype setting for the dropdown menu. This unfortunately results into a horizontal menu list. To be able to adjust this, i added the displayType, used for the transition, setting to the dropdown module as well. If set, this setting could be used just as in transition to correct the display if needed. Additionally this setting also had to be provided to the hiding transition, otherwise the wrong flex setting would be reapplied before hiding the dropdown again.
1 parent 65fe7e5 commit 8ae681c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/definitions/modules/dropdown.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,9 @@ $.fn.dropdown = function(parameters) {
21362136
;
21372137
}
21382138
return $selectedItem;
2139+
},
2140+
displayType: function() {
2141+
return $module.hasClass('column') ? 'flex' : settings.displayType;
21392142
}
21402143
},
21412144

@@ -3565,11 +3568,10 @@ $.fn.dropdown = function(parameters) {
35653568
module.set.scrollPosition(module.get.selectedItem(), true);
35663569
}
35673570
if( module.is.hidden($currentMenu) || module.is.animating($currentMenu) ) {
3568-
var displayType = $module.hasClass('column') ? 'flex' : false;
35693571
if(transition == 'none') {
35703572
start();
35713573
$currentMenu.transition({
3572-
displayType: displayType
3574+
displayType: module.get.displayType()
35733575
}).transition('show');
35743576
callback.call(element);
35753577
}
@@ -3582,7 +3584,7 @@ $.fn.dropdown = function(parameters) {
35823584
duration : settings.duration,
35833585
queue : true,
35843586
onStart : start,
3585-
displayType: displayType,
3587+
displayType: module.get.displayType(),
35863588
onComplete : function() {
35873589
callback.call(element);
35883590
}
@@ -3616,7 +3618,9 @@ $.fn.dropdown = function(parameters) {
36163618

36173619
if(transition == 'none') {
36183620
start();
3619-
$currentMenu.transition('hide');
3621+
$currentMenu.transition({
3622+
displayType: module.get.displayType()
3623+
}).transition('hide');
36203624
callback.call(element);
36213625
}
36223626
else if($.fn.transition !== undefined && $module.transition('is supported')) {
@@ -3628,6 +3632,7 @@ $.fn.dropdown = function(parameters) {
36283632
verbose : settings.verbose,
36293633
queue : false,
36303634
onStart : start,
3635+
displayType: module.get.displayType(),
36313636
onComplete : function() {
36323637
callback.call(element);
36333638
}
@@ -3956,6 +3961,7 @@ $.fn.dropdown.settings = {
39563961

39573962
transition : 'auto', // auto transition will slide down or up based on direction
39583963
duration : 200, // duration of transition
3964+
displayType : false, // displayType of transition
39593965

39603966
glyphWidth : 1.037, // widest glyph width in em (W is 1.037 em) used to calculate multiselect input width
39613967

0 commit comments

Comments
 (0)