viewSelector: notify on active page changes

In order to do this, we also need to move the assignment of
this._activePage from the animation onComplete callback to the function
itself.

https://bugzilla.gnome.org/show_bug.cgi?id=682050
This commit is contained in:
Cosimo Cecchi 2013-01-24 16:35:11 -05:00
parent 3d8a87563d
commit f2edcb9bdf

View File

@ -201,24 +201,27 @@ const ViewSelector = new Lang.Class({
}, },
_showPage: function(page) { _showPage: function(page) {
if(page == this._activePage) if (page == this._activePage)
return; return;
if(this._activePage) { let oldPage = this._activePage;
Tweener.addTween(this._activePage, if (oldPage) {
Tweener.addTween(oldPage,
{ opacity: 0, { opacity: 0,
time: 0.1, time: 0.1,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: Lang.bind(this, onComplete: Lang.bind(this,
function() { function() {
this._activePage.hide(); oldPage.hide();
this._activePage = page;
}) })
}); });
} }
page.show(); this._activePage = page;
Tweener.addTween(page, this._activePage.show();
this.emit('page-changed');
Tweener.addTween(this._activePage,
{ opacity: 255, { opacity: 255,
time: 0.1, time: 0.1,
transition: 'easeOutQuad' transition: 'easeOutQuad'