REFACTOR: removes overwritten properties and duplicates fn (#9686)
This commit is contained in:
parent
265baa40c6
commit
1dd9df9cd0
|
@ -59,8 +59,6 @@ export default Component.extend({
|
|||
forcedModes: null,
|
||||
showAllReportsLink: false,
|
||||
filters: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
showTrend: false,
|
||||
showHeader: true,
|
||||
showTitle: true,
|
||||
|
|
|
@ -6,9 +6,6 @@ import { next, debounce, cancel } from "@ember/runloop";
|
|||
const DEBOUNCE_MS = 500;
|
||||
|
||||
export default TextField.extend({
|
||||
_prevValue: null,
|
||||
_timer: null,
|
||||
|
||||
attributeBindings: [
|
||||
"autocorrect",
|
||||
"autocapitalize",
|
||||
|
@ -17,13 +14,22 @@ export default TextField.extend({
|
|||
"dir"
|
||||
],
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this._prevValue = null;
|
||||
this._timer = null;
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this._prevValue = this.value;
|
||||
},
|
||||
|
||||
didUpdateAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this._prevValue !== this.value) {
|
||||
if (this.onChangeImmediate) {
|
||||
next(() => this.onChangeImmediate(this.value));
|
||||
|
@ -71,27 +77,6 @@ export default TextField.extend({
|
|||
}
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this._prevValue = this.value;
|
||||
},
|
||||
|
||||
didUpdateAttrs() {
|
||||
this._super(...arguments);
|
||||
if (this._prevValue !== this.value) {
|
||||
if (this.onChangeImmediate) {
|
||||
next(() => this.onChangeImmediate(this.value));
|
||||
}
|
||||
if (this.onChange) {
|
||||
debounce(this, this._debouncedChange, DEBOUNCE_MS);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_debouncedChange() {
|
||||
next(() => this.onChange(this.value));
|
||||
},
|
||||
|
||||
@discourseComputed("placeholderKey")
|
||||
placeholder: {
|
||||
get() {
|
||||
|
|
|
@ -95,8 +95,6 @@ export default Controller.extend({
|
|||
scopedCategoryId: null,
|
||||
lastValidatedAt: null,
|
||||
isUploading: false,
|
||||
allowUpload: false,
|
||||
uploadIcon: "upload",
|
||||
topic: null,
|
||||
linkLookup: null,
|
||||
showPreview: true,
|
||||
|
|
|
@ -24,7 +24,6 @@ export default Component.extend({
|
|||
formats: null,
|
||||
recurring: null,
|
||||
advancedMode: false,
|
||||
isValid: true,
|
||||
timezone: null,
|
||||
fromSelected: null,
|
||||
fromFilled: notEmpty("date"),
|
||||
|
|
Loading…
Reference in New Issue