Merge pull request #55 from jbrw/master
REFACTOR - remove _.debounce and _.isEqual
Dieser Commit ist enthalten in:
Commit
5c65a8d9f8
2 geänderte Dateien mit 26 neuen und 24 gelöschten Zeilen
|
@ -3,6 +3,7 @@ import { default as wizardSchema } from '../lib/wizard-schema';
|
||||||
import { set, get } from "@ember/object";
|
import { set, get } from "@ember/object";
|
||||||
import Mixin from "@ember/object/mixin";
|
import Mixin from "@ember/object/mixin";
|
||||||
import { observes } from 'discourse-common/utils/decorators';
|
import { observes } from 'discourse-common/utils/decorators';
|
||||||
|
import { deepEqual } from 'discourse-common/lib/object';
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -90,7 +91,7 @@ export default Mixin.create({
|
||||||
toggleUndo() {
|
toggleUndo() {
|
||||||
const current = this.get(this.componentType);
|
const current = this.get(this.componentType);
|
||||||
const original = this.originalObject;
|
const original = this.originalObject;
|
||||||
this.set('showUndo', !_.isEqual(current, original));
|
this.set('showUndo', !deepEqual(current, original));
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
|
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
|
||||||
import getUrl from 'discourse-common/lib/get-url';
|
import getUrl from 'discourse-common/lib/get-url';
|
||||||
|
import discourseDebounce from "discourse/lib/debounce";
|
||||||
|
|
||||||
var cache = {},
|
var cache = {},
|
||||||
cacheTopicId,
|
cacheTopicId,
|
||||||
|
@ -39,7 +40,7 @@ function performSearch(term, topicId, includeGroups, includeMentionableGroups, i
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var debouncedSearch = _.debounce(performSearch, 300);
|
var debouncedSearch = discourseDebounce(performSearch, 300);
|
||||||
|
|
||||||
function organizeResults(r, options) {
|
function organizeResults(r, options) {
|
||||||
if (r === CANCELLED_STATUS) { return r; }
|
if (r === CANCELLED_STATUS) { return r; }
|
||||||
|
|
Laden …
In neuem Issue referenzieren