[gnome-shell] panel: Fix a JS warning



commit 28d098394acff4d9d9ca0651edd64fd626a636bc
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jun 13 04:46:37 2017 +0200

    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

 js/ui/panel.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 52c89d7..d9df261 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1160,7 +1160,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',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]