[gnome-maps/wip/refactor2: 6/9] Sidebar: Reorder definitions



commit 74b52b3229d827b9ec442f3cdbf46458e753876e
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Mon Oct 13 20:21:53 2014 +0200

    Sidebar: Reorder definitions
    
    Define InstructionRow before Sidebar instead of after it. Fixing a
    JSHint error about usages before definitions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699967

 src/sidebar.js |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index 1eb4673..9529e06 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -31,6 +31,31 @@ const PlaceEntry = imports.placeEntry;
 const RouteQuery = imports.routeQuery;
 const Utils = imports.utils;
 
+const InstructionRow = new Lang.Class({
+    Name: "InstructionRow",
+    Extends: Gtk.ListBoxRow,
+
+    _init: function(params) {
+        this.turnPoint = params.turnPoint;
+        delete params.turnPoint;
+
+        this.parent(params);
+
+        this.visible = true;
+        let ui = Utils.getUIObject('sidebar', ['instruction-box',
+                                               'direction-image',
+                                               'instruction-label',
+                                               'distance-label']);
+        ui.instructionLabel.label = this.turnPoint.instruction;
+        ui.directionImage.icon_name = this.turnPoint.iconName;
+
+        if (this.turnPoint.distance > 0)
+            ui.distanceLabel.label = Utils.prettyDistance(this.turnPoint.distance);
+
+        this.add(ui.instructionBox);
+    }
+});
+
 const Sidebar = new Lang.Class({
     Name: 'Sidebar',
     Extends: Gtk.Revealer,
@@ -208,28 +233,3 @@ const Sidebar = new Lang.Class({
         this._distanceInfo.label = '';
     }
 });
-
-const InstructionRow = new Lang.Class({
-    Name: "InstructionRow",
-    Extends: Gtk.ListBoxRow,
-
-    _init: function(params) {
-        this.turnPoint = params.turnPoint;
-        delete params.turnPoint;
-
-        this.parent(params);
-
-        this.visible = true;
-        let ui = Utils.getUIObject('sidebar', ['instruction-box',
-                                               'direction-image',
-                                               'instruction-label',
-                                               'distance-label']);
-        ui.instructionLabel.label = this.turnPoint.instruction;
-        ui.directionImage.icon_name = this.turnPoint.iconName;
-
-        if (this.turnPoint.distance > 0)
-            ui.distanceLabel.label = Utils.prettyDistance(this.turnPoint.distance);
-
-        this.add(ui.instructionBox);
-    }
-});


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