diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index af0d9e19f..d7f3880c4 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -251,8 +251,16 @@ const PopupSeparatorMenuItem = new Lang.Class({ this.actor.add(this.label); this.actor.label_actor = this.label; + this.label.connect('notify::text', + Lang.bind(this, this._syncVisibility)); + this._syncVisibility(); + this._separator = new Separator.HorizontalSeparator({ style_class: 'popup-separator-menu-item' }); this.actor.add(this._separator.actor, { expand: true }); + }, + + _syncVisibility: function() { + this.label.visible = this.label.text != ''; } });