From 8d9974556f0f99ec344b7554594a062d93c5d1c1 Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Fri, 10 Feb 2017 00:29:15 +0100 Subject: [PATCH] Fix warning. --- src/prefs.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/prefs.js b/src/prefs.js index 9dca840..87a15b7 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -175,10 +175,14 @@ const WeatherPrefsWidget = new GObject.Class({ if (location === "") return 0; - let item = new Gtk.MenuItem(); - if (this.spinner.get_parent()) - this.spinner.reparent(item); - item.add(this.spinner); + let item; + if (this.spinner.get_parent()) { + item = this.spinner.get_parent(); + }else { + item = new Gtk.MenuItem() + item.add(this.spinner); + } + this.searchMenu.append(item); this.searchMenu.show_all(); this.searchMenu.popup(null, null, Lang.bind(this, this.placeSearchMenu), 0, this.searchName);