mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: allows to import isPresent (#8993)
This commit is contained in:
@@ -2,6 +2,7 @@ import deprecated from "discourse-common/lib/deprecated";
|
||||
import SelectKitComponent from "select-kit/components/select-kit";
|
||||
import { computed } from "@ember/object";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { isPresent } from "@ember/utils";
|
||||
|
||||
export default SelectKitComponent.extend({
|
||||
pluginApiIdentifiers: ["multi-select"],
|
||||
@@ -41,7 +42,7 @@ export default SelectKitComponent.extend({
|
||||
},
|
||||
|
||||
select(value, item) {
|
||||
if (!Ember.isPresent(value)) {
|
||||
if (!isPresent(value)) {
|
||||
if (!this.validateSelect(this.selectKit.highlighted)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { get } from "@ember/object";
|
||||
import UtilsMixin from "select-kit/mixins/utils";
|
||||
import PluginApiMixin from "select-kit/mixins/plugin-api";
|
||||
import Mixin from "@ember/object/mixin";
|
||||
import { isEmpty, isNone } from "@ember/utils";
|
||||
import { isPresent, isEmpty, isNone } from "@ember/utils";
|
||||
import {
|
||||
next,
|
||||
debounce,
|
||||
@@ -422,8 +422,8 @@ export default Component.extend(
|
||||
}
|
||||
|
||||
if (this.singleSelect) {
|
||||
value = Ember.isPresent(value.firstObject) ? value.firstObject : null;
|
||||
items = Ember.isPresent(items.firstObject) ? items.firstObject : null;
|
||||
value = isPresent(value.firstObject) ? value.firstObject : null;
|
||||
items = isPresent(items.firstObject) ? items.firstObject : null;
|
||||
}
|
||||
|
||||
this._boundaryActionHandler("onChange", value, items);
|
||||
@@ -704,7 +704,7 @@ export default Component.extend(
|
||||
},
|
||||
|
||||
select(value, item) {
|
||||
if (!Ember.isPresent(value)) {
|
||||
if (!isPresent(value)) {
|
||||
if (!this.validateSelect(this.selectKit.highlighted)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user