prehighlight the text for editing when taken to a new map

This commit is contained in:
Connor Turland 2016-10-02 18:16:53 -04:00
parent 7ec9feff80
commit a4cbcc5a2d
3 changed files with 7 additions and 3 deletions

View file

@ -9,7 +9,7 @@ class ExploreController < ApplicationController
# GET /explore/active # GET /explore/active
def active def active
@maps = map_scope(Map) @maps = map_scope(Map.where.not(name: 'Untitled Map'))
respond_to do |format| respond_to do |format|
format.html do format.html do

View file

@ -12,7 +12,7 @@ class MainController < ApplicationController
skip_policy_scope skip_policy_scope
render 'main/home' render 'main/home'
else else
@maps = policy_scope(Map).order(updated_at: :desc).page(1).per(20) @maps = policy_scope(Map.where.not(name: 'Untitled Map')).order(updated_at: :desc).page(1).per(20)
render 'explore/active' render 'explore/active'
end end
end end

View file

@ -38,6 +38,9 @@ const InfoBox = {
if (querystring == 'new') { if (querystring == 'new') {
self.open() self.open()
$('.mapInfoBox').addClass('mapRequestTitle') $('.mapInfoBox').addClass('mapRequestTitle')
$('#mapInfoName').trigger('click')
$('#mapInfoName textarea').focus()
$('#mapInfoName textarea').select()
} }
}, },
toggleBox: function (event) { toggleBox: function (event) {
@ -139,7 +142,8 @@ const InfoBox = {
// mobile menu // mobile menu
$('#header_content').html(name) $('#header_content').html(name)
$('.mapInfoBox').removeClass('mapRequestTitle') $('.mapInfoBox').removeClass('mapRequestTitle')
document.title = name + ' | Metamaps' document.title = `${name} | Metamaps`
window.history.replaceState('', `${name} | Metamaps`, window.location.pathname)
}) })
$('.mapInfoDesc .best_in_place_desc').unbind('ajax:success').bind('ajax:success', function () { $('.mapInfoDesc .best_in_place_desc').unbind('ajax:success').bind('ajax:success', function () {