mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: ensure s2 is working with wizard (#8886)
This commit is contained in:
@ -774,13 +774,17 @@ export default Component.extend(
|
|||||||
`[data-select-kit-id=${this.selectKit.uniqueID}-body]`
|
`[data-select-kit-id=${this.selectKit.uniqueID}-body]`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!this.site.mobileView && popper.offsetWidth < anchor.offsetWidth) {
|
if (
|
||||||
|
this.site &&
|
||||||
|
!this.site.mobileView &&
|
||||||
|
popper.offsetWidth < anchor.offsetWidth
|
||||||
|
) {
|
||||||
popper.style.minWidth = `${anchor.offsetWidth}px`;
|
popper.style.minWidth = `${anchor.offsetWidth}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const inModal = $(this.element).parents("#discourse-modal").length;
|
const inModal = $(this.element).parents("#discourse-modal").length;
|
||||||
|
|
||||||
if (!this.site.mobileView && inModal) {
|
if (this.site && !this.site.mobileView && inModal) {
|
||||||
popper.style.width = `${anchor.offsetWidth}px`;
|
popper.style.width = `${anchor.offsetWidth}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { fmt } from "discourse/lib/computed";
|
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { isEmpty } from "@ember/utils";
|
import { isEmpty } from "@ember/utils";
|
||||||
@ -11,7 +10,9 @@ export default Component.extend(UtilsMixin, {
|
|||||||
classNames: ["select-kit-filter"],
|
classNames: ["select-kit-filter"],
|
||||||
classNameBindings: ["isExpanded:is-expanded"],
|
classNameBindings: ["isExpanded:is-expanded"],
|
||||||
attributeBindings: ["selectKitId:data-select-kit-id"],
|
attributeBindings: ["selectKitId:data-select-kit-id"],
|
||||||
selectKitId: fmt("selectKit.uniqueID", "%@-filter"),
|
selectKitId: computed("selectKit.uniqueID", function() {
|
||||||
|
return `${this.selectKit.uniqueID}-filter`;
|
||||||
|
}),
|
||||||
|
|
||||||
isHidden: computed(
|
isHidden: computed(
|
||||||
"selectKit.options.{filterable,allowAny,autoFilterable}",
|
"selectKit.options.{filterable,allowAny,autoFilterable}",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { propertyEqual } from "discourse/lib/computed";
|
|
||||||
import { computed } from "@ember/object";
|
import { computed } from "@ember/object";
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
import { guidFor } from "@ember/object/internals";
|
import { guidFor } from "@ember/object/internals";
|
||||||
@ -74,9 +73,13 @@ export default Component.extend(UtilsMixin, {
|
|||||||
return this.getValue(this.selectKit.highlighted);
|
return this.getValue(this.selectKit.highlighted);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
isHighlighted: propertyEqual("rowValue", "highlightedValue"),
|
isHighlighted: computed("rowValue", "highlightedValue", function() {
|
||||||
|
return this.rowValue === this.highlightedValue;
|
||||||
|
}),
|
||||||
|
|
||||||
isSelected: propertyEqual("rowValue", "value"),
|
isSelected: computed("rowValue", "value", function() {
|
||||||
|
return this.rowValue === this.value;
|
||||||
|
}),
|
||||||
|
|
||||||
mouseEnter() {
|
mouseEnter() {
|
||||||
if (!this.isDestroying || !this.isDestroyed) {
|
if (!this.isDestroying || !this.isDestroyed) {
|
||||||
|
@ -27,7 +27,9 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="is-loading">
|
<span class="is-loading">
|
||||||
{{loading-spinner size="small"}}
|
{{#if site}}
|
||||||
|
{{loading-spinner size="small"}}
|
||||||
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/select-kit/select-kit-body}}
|
{{/select-kit/select-kit-body}}
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
//= require sweetalert.js
|
//= require sweetalert.js
|
||||||
//= require virtual-dom
|
//= require virtual-dom
|
||||||
//= require virtual-dom-amd
|
//= require virtual-dom-amd
|
||||||
|
//= require popper
|
||||||
|
Reference in New Issue
Block a user