[gnome-maps/wip/mattiasb/templates: 9/10] ContextMenu: Use params pattern
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mattiasb/templates: 9/10] ContextMenu: Use params pattern
- Date: Tue, 24 Mar 2015 19:51:07 +0000 (UTC)
commit 558121564e125ddcd9f6bc41758f283601a30296
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 7838f3f..16408f6 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 56bc058..96a11b3 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -78,7 +78,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]