]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Don't centre on load if the location is already in view
[rails.git] / app / controllers / browse_controller.rb
index 7056539cb1030bb1d358b334eff3fc589d9cb756..f0b92f4b47a33e7f8fbe7208348598f7b5b61cca 100644 (file)
@@ -58,8 +58,11 @@ class BrowseController < ApplicationController
   def changeset
     @type = "changeset"
     @changeset = Changeset.find(params[:id])
-    @comments = @changeset.comments.unscope(:where => :visible).includes(:author) if @user and @user.moderator?
-    @comments ||= @changeset.comments.includes(:author)
+    if @user and @user.moderator?
+      @comments = @changeset.comments.unscope(:where => :visible).includes(:author)
+    else
+      @comments = @changeset.comments.includes(:author)
+    end
     @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'node_page')
     @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'way_page')
     @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'relation_page')