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;
background: #E0E0E0;
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);
}

View file

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