Changed pager spinner to be smoother
This commit is contained in:
parent
abc3259222
commit
f2b5124d54
1 changed files with 10 additions and 11 deletions
|
@ -18,22 +18,21 @@ App.PresenterManager = function(jQuery, promise, topNavigationPresenter, keyboar
|
|||
}
|
||||
|
||||
function showContentSpinner() {
|
||||
if (spinnerTimeout !== null) {
|
||||
spinnerTimeout = window.setTimeout(function() {
|
||||
$spinner.show();
|
||||
}, 150);
|
||||
}
|
||||
}
|
||||
|
||||
function hideContentSpinner() {
|
||||
window.clearTimeout(spinnerTimeout);
|
||||
spinnerTimeout = null;
|
||||
$spinner.hide();
|
||||
}
|
||||
|
||||
function switchContentPresenter(presenter, args) {
|
||||
var contentPresenterLoaded = function() {
|
||||
window.clearTimeout(spinnerTimeout);
|
||||
hideContentSpinner();
|
||||
};
|
||||
|
||||
spinnerTimeout = window.setTimeout(function() {
|
||||
showContentSpinner();
|
||||
}, 100);
|
||||
|
||||
if (lastContentPresenter === null || lastContentPresenter.name !== presenter.name) {
|
||||
if (lastContentPresenter !== null && lastContentPresenter.deinit) {
|
||||
|
@ -42,10 +41,10 @@ App.PresenterManager = function(jQuery, promise, topNavigationPresenter, keyboar
|
|||
keyboard.reset();
|
||||
topNavigationPresenter.changeTitle(null);
|
||||
topNavigationPresenter.focus();
|
||||
presenter.init.call(presenter, args, contentPresenterLoaded);
|
||||
presenter.init.call(presenter, args, hideContentSpinner);
|
||||
lastContentPresenter = presenter;
|
||||
} else if (lastContentPresenter.reinit) {
|
||||
lastContentPresenter.reinit.call(lastContentPresenter, args, contentPresenterLoaded);
|
||||
lastContentPresenter.reinit.call(lastContentPresenter, args, hideContentSpinner);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue