Skip to content

Commit

Permalink
Add missing loading finished handling (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrell authored and SQiShER committed Apr 27, 2016
1 parent e9ae0e7 commit dcea9ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/core/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ function changeQuery(state, options, query) {
return state;
}

function startLoading(state, options) {
if (options.onLoaded) {
options.onLoaded();
}
function startLoading(state) {
return $.extend({}, state, {
itemsLoading: true,
});
}

function finishLoading(state) {
function finishLoading(state, options) {
if (options.onLoaded) {
options.onLoaded();
}
return $.extend({}, state, {
itemsLoading: false,
itemsLoaded: true,
Expand Down
2 changes: 1 addition & 1 deletion src/virtual-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function VirtualSelect(element, userOptions) {
}
changeState(fn.startLoading(state));
return options.dataProvider.load().then(() => {
changeState(fn.finishLoading(state));
changeState(fn.finishLoading(state, options));
});
}

Expand Down

0 comments on commit dcea9ec

Please sign in to comment.