FIX: allows to define placement strategy of select-kit body (#9109)
This commit is contained in:
parent
29c9d8a133
commit
bb5990781e
|
@ -29,6 +29,9 @@
|
||||||
value=selectedGroup
|
value=selectedGroup
|
||||||
valueProperty=null
|
valueProperty=null
|
||||||
nameProperty=null
|
nameProperty=null
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
{{combo-box
|
{{combo-box
|
||||||
class="permission-selector"
|
class="permission-selector"
|
||||||
|
@ -36,6 +39,9 @@
|
||||||
content=category.availablePermissions
|
content=category.availablePermissions
|
||||||
onChange=(action "onSelectPermission")
|
onChange=(action "onSelectPermission")
|
||||||
value=selectedPermission
|
value=selectedPermission
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
{{d-button
|
{{d-button
|
||||||
action=(action "addPermission" selectedGroup selectedPermission)
|
action=(action "addPermission" selectedGroup selectedPermission)
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
content=searchPrioritiesOptions
|
content=searchPrioritiesOptions
|
||||||
value=category.search_priority
|
value=category.search_priority
|
||||||
onChange=(action (mut category.search_priority))
|
onChange=(action (mut category.search_priority))
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -148,7 +151,15 @@
|
||||||
{{i18n "category.default_view"}}
|
{{i18n "category.default_view"}}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{combo-box valueProperty="value" id="category-default-view" content=availableViews value=category.default_view}}
|
{{combo-box
|
||||||
|
valueProperty="value"
|
||||||
|
id="category-default-view"
|
||||||
|
content=availableViews
|
||||||
|
value=category.default_view
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -157,7 +168,15 @@
|
||||||
{{i18n "category.default_top_period"}}
|
{{i18n "category.default_top_period"}}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{combo-box valueProperty="value" id="category-default-period" content=availableTopPeriods value=category.default_top_period}}
|
{{combo-box
|
||||||
|
valueProperty="value"
|
||||||
|
id="category-default-period"
|
||||||
|
content=availableTopPeriods
|
||||||
|
value=category.default_top_period
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -168,7 +187,16 @@
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{combo-box valueProperty="value" content=availableSorts value=category.sort_order none="category.sort_options.default"}}
|
{{combo-box valueProperty="value" content=availableSorts value=category.sort_order none="category.sort_options.default"}}
|
||||||
{{#unless isDefaultSortOrder}}
|
{{#unless isDefaultSortOrder}}
|
||||||
{{combo-box castBoolean=true valueProperty="value" content=sortAscendingOptions value=category.sort_ascending none="category.sort_options.default"}}
|
{{combo-box
|
||||||
|
castBoolean=true
|
||||||
|
valueProperty="value"
|
||||||
|
content=sortAscendingOptions
|
||||||
|
value=category.sort_ascending
|
||||||
|
none="category.sort_options.default"
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
|
}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -187,7 +215,15 @@
|
||||||
<label for="subcategory-list-style">
|
<label for="subcategory-list-style">
|
||||||
{{i18n "category.subcategory_list_style"}}
|
{{i18n "category.subcategory_list_style"}}
|
||||||
</label>
|
</label>
|
||||||
{{combo-box valueProperty="value" id="subcategory-list-style" content=availableSubcategoryListStyles value=category.subcategory_list_style}}
|
{{combo-box
|
||||||
|
valueProperty="value"
|
||||||
|
id="subcategory-list-style"
|
||||||
|
content=availableSubcategoryListStyles
|
||||||
|
value=category.subcategory_list_style
|
||||||
|
options=(hash
|
||||||
|
placementStrategy="absolute"
|
||||||
|
)
|
||||||
|
}}
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
@ -267,6 +267,7 @@ export default Component.extend(
|
||||||
closeOnChange: true,
|
closeOnChange: true,
|
||||||
limitMatches: null,
|
limitMatches: null,
|
||||||
placement: "bottom-start",
|
placement: "bottom-start",
|
||||||
|
placementStrategy: null,
|
||||||
filterComponent: "select-kit/select-kit-filter",
|
filterComponent: "select-kit/select-kit-filter",
|
||||||
selectedNameComponent: "selected-name",
|
selectedNameComponent: "selected-name",
|
||||||
castInteger: false
|
castInteger: false
|
||||||
|
@ -814,10 +815,15 @@ export default Component.extend(
|
||||||
popper.style.width = `${anchor.offsetWidth}px`;
|
popper.style.width = `${anchor.offsetWidth}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let placementStrategy = this.selectKit.options.placementStrategy;
|
||||||
|
if (!placementStrategy) {
|
||||||
|
placementStrategy = this.inModal ? "fixed" : "absolute";
|
||||||
|
}
|
||||||
|
|
||||||
/* global Popper:true */
|
/* global Popper:true */
|
||||||
this.popper = Popper.createPopper(anchor, popper, {
|
this.popper = Popper.createPopper(anchor, popper, {
|
||||||
eventsEnabled: false,
|
eventsEnabled: false,
|
||||||
strategy: inModal ? "fixed" : "absolute",
|
strategy: placementStrategy,
|
||||||
placement: this.selectKit.options.placement,
|
placement: this.selectKit.options.placement,
|
||||||
modifiers: [
|
modifiers: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue