[Commits] r2220 - sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux

commits at geoext.org commits at geoext.org
Mon May 31 14:41:59 CEST 2010


Author: fredj
Date: 2010-05-31 14:41:59 +0200 (Mon, 31 May 2010)
New Revision: 2220

Modified:
   sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js
Log:
coding style, don't use local var for bbar and items (see #288)

Modified: sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js	2010-05-28 12:39:38 UTC (rev 2219)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js	2010-05-31 12:41:59 UTC (rev 2220)
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ * Copyright (c) 2008-2010 The Open Source Geospatial Foundation
  * 
  * Published under the BSD license.
  * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
@@ -11,6 +11,7 @@
 /** api: (define)
  *  module = GeoExt.ux
  *  class = FeatureBrowser
+ *  base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
  */
 
 /** api: constructor
@@ -68,22 +69,20 @@
 
         var nbFeatures = this.features.length;
 
-        var items = [],
-            feature,
-            tpl;
+        this.items = [];
+        var feature, tpl;
         for (var i = 0; i < nbFeatures; i++) {
             feature = this.features[i];
             tpl = this.getTemplateForFeature(feature);
             
-            items.push(new Ext.BoxComponent({
+            this.items.push(new Ext.BoxComponent({
                 id: 'card-'+ this.id + i,
                 html: tpl.apply(feature.attributes)
             }));
         }
 
-        var bbar = false;
         if (nbFeatures > 1) {
-            bbar = [
+            this.bbar = [
                 {xtype: 'tbtext', id: 'counter-' + this.id},
                 '->',
                 {
@@ -111,8 +110,6 @@
                 }
             ];
         }
-        this.items = items;
-        this.bbar = bbar;
         this.activeItem = 0;
 
         GeoExt.ux.FeatureBrowser.superclass.initComponent.apply(this, arguments);
@@ -149,8 +146,8 @@
         var next = parseInt(i, 10) + direction;
         lay.setActiveItem(next);
         this.fireEvent('featureselected', this, features[next]);
-        Ext.getCmp('move-prev' + this.id).setDisabled(next===0);
-        Ext.getCmp('move-next' + this.id).setDisabled(next==total - 1);
+        Ext.getCmp('move-prev' + this.id).setDisabled(next === 0);
+        Ext.getCmp('move-next' + this.id).setDisabled(next == total - 1);
 
         var counter = Ext.getCmp('counter-' + this.id);
         counter && counter.setText(



More information about the Commits mailing list