panel: Fix a JS warning

We need to track the open-status of indicator menus, but don't want
to hook up signals more than once, so we check for the handler ID
we store on the object. As the property is only defined once we did
set up the signal connection, this check now logs a warning. We
can avoid it by checking for the existence of the property rather
than a particular value.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
This commit is contained in:
Florian Müllner 2017-06-13 04:46:37 +02:00
parent 26433c2cb7
commit 363d35a3eb

View File

@ -1104,7 +1104,7 @@ const Panel = new Lang.Class({
},
_onMenuSet: function(indicator) {
if (!indicator.menu || indicator.menu._openChangedId > 0)
if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId'))
return;
indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',