osdWindow: Don't tween to undefined

Check that we got a valid level before setting the level bar to it, to
prevent a Tweener warning.
This commit is contained in:
Jasper St. Pierre 2013-04-14 11:32:21 -04:00
parent 7051411be7
commit 7101cc3170

View File

@ -125,13 +125,15 @@ const OsdWindow = new Lang.Class({
setLevel: function(level) {
this._level.actor.visible = (level != undefined);
if (this.actor.visible)
Tweener.addTween(this._level,
{ level: level,
time: LEVEL_ANIMATION_TIME,
transition: 'easeOutQuad' });
else
this._level.level = level;
if (level) {
if (this.actor.visible)
Tweener.addTween(this._level,
{ level: level,
time: LEVEL_ANIMATION_TIME,
transition: 'easeOutQuad' });
else
this._level.level = level;
}
},
show: function() {