mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-06 07:43:12 +02:00
Rename _clearChoices to clearChoices
This commit is contained in:
parent
bbbc31594c
commit
fc9bca2ece
|
@ -417,7 +417,7 @@ class Choices {
|
||||||
|
|
||||||
// Clear choices if needed
|
// Clear choices if needed
|
||||||
if (replaceChoices) {
|
if (replaceChoices) {
|
||||||
this._clearChoices();
|
this.clearChoices();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.containerOuter.removeLoadingState();
|
this.containerOuter.removeLoadingState();
|
||||||
|
@ -448,6 +448,10 @@ class Choices {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearChoices() {
|
||||||
|
this._store.dispatch(clearChoices());
|
||||||
|
}
|
||||||
|
|
||||||
clearStore() {
|
clearStore() {
|
||||||
this._store.dispatch(clearAll());
|
this._store.dispatch(clearAll());
|
||||||
return this;
|
return this;
|
||||||
|
@ -1729,10 +1733,6 @@ class Choices {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_clearChoices() {
|
|
||||||
this._store.dispatch(clearChoices());
|
|
||||||
}
|
|
||||||
|
|
||||||
_addGroup({ group, id, valueKey = 'value', labelKey = 'label' }) {
|
_addGroup({ group, id, valueKey = 'value', labelKey = 'label' }) {
|
||||||
const groupChoices = isType('Object', group)
|
const groupChoices = isType('Object', group)
|
||||||
? group.choices
|
? group.choices
|
||||||
|
|
|
@ -1339,14 +1339,14 @@ describe('choices', () => {
|
||||||
addChoiceStub = stub();
|
addChoiceStub = stub();
|
||||||
containerOuterRemoveLoadingStateStub = stub();
|
containerOuterRemoveLoadingStateStub = stub();
|
||||||
|
|
||||||
instance._clearChoices = clearChoicesStub;
|
instance.clearChoices = clearChoicesStub;
|
||||||
instance._addGroup = addGroupStub;
|
instance._addGroup = addGroupStub;
|
||||||
instance._addChoice = addChoiceStub;
|
instance._addChoice = addChoiceStub;
|
||||||
instance.containerOuter.removeLoadingState = containerOuterRemoveLoadingStateStub;
|
instance.containerOuter.removeLoadingState = containerOuterRemoveLoadingStateStub;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
instance._clearChoices.reset();
|
instance.clearChoices.reset();
|
||||||
instance._addGroup.reset();
|
instance._addGroup.reset();
|
||||||
instance._addChoice.reset();
|
instance._addChoice.reset();
|
||||||
instance.containerOuter.removeLoadingState.reset();
|
instance.containerOuter.removeLoadingState.reset();
|
||||||
|
|
Loading…
Reference in a new issue