pushState based navigation between map-based layouts

This commit is contained in:
John Firebaugh 2013-10-02 16:41:44 -07:00
parent 64cb9b0a8b
commit a56d1036d5
13 changed files with 275 additions and 143 deletions

View file

@ -422,6 +422,10 @@ class ApplicationController < ActionController::Base
request.body.rewind
end
def map_layout
request.xhr? ? false : 'map'
end
def preferred_editor
editor = if params[:editor]
params[:editor]

View file

@ -1,5 +1,5 @@
class BrowseController < ApplicationController
layout 'map'
layout :map_layout
before_filter :authorize_web
before_filter :set_locale

View file

@ -321,7 +321,7 @@ class ChangesetController < ApplicationController
@edits = changesets.order("changesets.created_at DESC").offset((@page - 1) * @page_size).limit(@page_size).preload(:user, :changeset_tags)
render :action => :list, :layout => 'map'
render :action => :list, :layout => map_layout
end
end

View file

@ -1,6 +1,6 @@
class SiteController < ApplicationController
layout 'site'
layout 'map', :only => [:index, :export]
layout :map_layout, :only => [:index, :export]
before_filter :authorize_web
before_filter :set_locale