starred maps display as starred without refreshing
This commit is contained in:
parent
0fdb38b0a5
commit
7824477d10
1 changed files with 3 additions and 1 deletions
|
@ -160,6 +160,7 @@ Metamaps.Map = {
|
||||||
if (!Metamaps.Active.Map) return
|
if (!Metamaps.Active.Map) return
|
||||||
$.post('/maps/' + Metamaps.Active.Map.id + '/star')
|
$.post('/maps/' + Metamaps.Active.Map.id + '/star')
|
||||||
Metamaps.Stars.push({ user_id: Metamaps.Active.Mapper.id, map_id: Metamaps.Active.Map.id })
|
Metamaps.Stars.push({ user_id: Metamaps.Active.Mapper.id, map_id: Metamaps.Active.Map.id })
|
||||||
|
Metamaps.Maps.Starred.add(Metamaps.Active.Map)
|
||||||
self.updateStar()
|
self.updateStar()
|
||||||
},
|
},
|
||||||
unstar: function () {
|
unstar: function () {
|
||||||
|
@ -168,6 +169,7 @@ Metamaps.Map = {
|
||||||
if (!Metamaps.Active.Map) return
|
if (!Metamaps.Active.Map) return
|
||||||
$.post('/maps/' + Metamaps.Active.Map.id + '/unstar')
|
$.post('/maps/' + Metamaps.Active.Map.id + '/unstar')
|
||||||
Metamaps.Stars = Metamaps.Stars.filter(function (s) { return s.user_id != Metamaps.Active.Mapper.id })
|
Metamaps.Stars = Metamaps.Stars.filter(function (s) { return s.user_id != Metamaps.Active.Mapper.id })
|
||||||
|
Metamaps.Maps.Starred.remove(Metamaps.Active.Map)
|
||||||
self.updateStar()
|
self.updateStar()
|
||||||
},
|
},
|
||||||
fork: function () {
|
fork: function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue