[gnome-maps] ContextMenu: Use params pattern



commit 0ab663bdadafb580e92b84ddb592b8dc9a5fe293
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Tue Mar 24 01:56:24 2015 +0100

    ContextMenu: Use params pattern
    
    This makes ContextMenu consistent with most other classes in Maps.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740647

 src/contextMenu.js |    8 +++++---
 src/mainWindow.js  |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/contextMenu.js b/src/contextMenu.js
index 58722e0..2708e93 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -34,9 +34,11 @@ const ContextMenu = new Lang.Class({
     Template: 'resource:///org/gnome/Maps/ui/context-menu.ui',
     InternalChildren: [ 'whatsHereItem' ],
 
-    _init: function(mapView) {
-        this._mapView = mapView;
-        this.parent();
+    _init: function(params) {
+        this._mapView = params.mapView;
+        delete params.mapView;
+
+        this.parent(params);
 
         this._mapView.view.connect('button-release-event',
                                    this._onButtonReleaseEvent.bind(this));
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 8b6e368..09c3e44 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -77,7 +77,7 @@ const MainWindow = new Lang.Class({
 
         this._sidebar = this._createSidebar();
 
-        this._contextMenu = new ContextMenu.ContextMenu(this._mapView);
+        this._contextMenu = new ContextMenu.ContextMenu({ mapView: this._mapView });
 
         this._layersButton.popover = new LayersPopover.LayersPopover();
         this._favoritesButton.popover = new FavoritesPopover.FavoritesPopover({ mapView: this._mapView });


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