mapper page bug fix and styling

This commit is contained in:
Connor Turland 2016-10-24 13:42:26 +00:00
parent 98e2de68da
commit a9ef6feebd
2 changed files with 11 additions and 9 deletions

View file

@ -965,7 +965,7 @@ font-family: 'din-regular', helvetica, sans-serif;
overflow: visible; overflow: visible;
background: #E0E0E0; background: #E0E0E0;
border-radius:2px; border-radius:2px;
margin:16px 16px 16px 19px; margin:16px;
box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16); box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16);
} }

View file

@ -14,6 +14,7 @@ import Maps from '../../components/Maps'
const ExploreMaps = { const ExploreMaps = {
pending: false, pending: false,
mapper: null,
setCollection: function (collection) { setCollection: function (collection) {
var self = ExploreMaps var self = ExploreMaps
@ -27,23 +28,18 @@ const ExploreMaps = {
self.collection.on('successOnFetch', self.handleSuccess) self.collection.on('successOnFetch', self.handleSuccess)
self.collection.on('errorOnFetch', self.handleError) self.collection.on('errorOnFetch', self.handleError)
}, },
render: function (mapperObj, cb) { render: function (cb) {
var self = ExploreMaps var self = ExploreMaps
if (!self.collection) return if (!self.collection) return
if (typeof mapperObj === 'function') {
cb = mapperObj
mapperObj = null
}
var exploreObj = { var exploreObj = {
currentUser: Active.Mapper, currentUser: Active.Mapper,
section: self.collection.id, section: self.collection.id,
maps: self.collection, maps: self.collection,
juntoState: Realtime.juntoState, juntoState: Realtime.juntoState,
moreToLoad: self.collection.page != 'loadedAll', moreToLoad: self.collection.page != 'loadedAll',
user: mapperObj, user: self.collection.id === 'mapper' ? self.mapper : null,
loadMore: self.loadMore, loadMore: self.loadMore,
pending: self.pending, pending: self.pending,
onStar: function (map) { onStar: function (map) {
@ -93,11 +89,17 @@ const ExploreMaps = {
fetchUserThenRender: function (cb) { fetchUserThenRender: function (cb) {
var self = ExploreMaps var self = ExploreMaps
if (self.mapper && self.mapper.id === self.collection.mapperId) {
self.render(cb)
return Metamaps.Loading.hide()
}
// first load the mapper object and then call the render function // first load the mapper object and then call the render function
$.ajax({ $.ajax({
url: '/users/' + self.collection.mapperId + '/details.json', url: '/users/' + self.collection.mapperId + '/details.json',
success: function (response) { success: function (response) {
self.render(response, cb) self.mapper = response
self.render(cb)
Metamaps.Loading.hide() Metamaps.Loading.hide()
}, },
error: function () { error: function () {